Re: [Haskell-cafe] Interesting new user perspective

2008-10-10 Thread Jonathan Cast
On Fri, 2008-10-10 at 22:24 +0100, Iain Barnett wrote: On 10 Oct 2008, at 9:00 pm, Tommy M. McGuire wrote: Iain Barnett wrote: On 9 Oct 2008, at 9:33 pm, Andrew Coppin wrote: I think it's just the teaching of the language that needs work, not so much the language itself. As a newer

Re: [Haskell-cafe] Interesting new user perspective

2008-10-10 Thread Jonathan Cast
On Fri, 2008-10-10 at 19:27 +0100, Iain Barnett wrote: On 10 Oct 2008, at 7:05 pm, Jonathan Cast wrote: On Fri, 2008-10-10 at 19:08 +0100, Iain Barnett wrote: In Haskell it is. Parsec makes recursive descent parsers as easy to use in Haskell as regexps are in Perl. No reason

Re: [Haskell-cafe] Interesting new user perspective

2008-10-10 Thread Jonathan Cast
On Fri, 2008-10-10 at 22:40 +0100, Andrew Coppin wrote: Iain Barnett wrote: On 10 Oct 2008, at 9:50 pm, Don Stewart wrote: Haskell makes constructing true parsers just as easy, You're not speaking for me there! :) I really like regex. It's a domain specific functional language,

Re: [Haskell-cafe] Interesting new user perspective

2008-10-10 Thread Jonathan Cast
On Fri, 2008-10-10 at 22:49 +0100, Andrew Coppin wrote: Jonathan Cast wrote: Newcomers flounder because they expect to keep programming the same way they always have. _Some_ newcommers flounder because they expect Haskell to be just another VB / C++ / Java / whatever. (Do we really want

Re: [Haskell-cafe] Interesting new user perspective

2008-10-10 Thread Jonathan Cast
On Fri, 2008-10-10 at 22:43 +0100, Andrew Coppin wrote: Jonathan Cast wrote: Why would I want to do I/O, when I don't know how to do anything interesting with the input yet, or how to generate interesting output? I think the `I/O comes first' attitude is *precisely* the difference between

Re: [Haskell-cafe] Hmm, what license to use?

2008-10-03 Thread Jonathan Cast
On Fri, 2008-10-03 at 10:08 -0700, David Leimbach wrote: On Fri, Oct 3, 2008 at 4:36 AM, minh thu [EMAIL PROTECTED] wrote: 2008/10/3 Mitchell, Neil [EMAIL PROTECTED]: Hi You mean shared libraries without the opportunity to

Re: [Haskell-cafe] Stacking monads

2008-10-03 Thread Jonathan Cast
On Fri, 2008-10-03 at 20:43 +0100, Andrew Coppin wrote: David Menendez wrote: It wasn't until fairly recently that people realized that you could do useful things if you had return and ap, but not (=), which why we have some unfortunate limitations in the Haskell prelude, like Applicative

Re: [Haskell-cafe] Stacking monads

2008-10-03 Thread Jonathan Cast
On Fri, 2008-10-03 at 21:02 +0100, Andrew Coppin wrote: Jonathan Cast wrote: On Fri, 2008-10-03 at 20:43 +0100, Andrew Coppin wrote: OK. So it's broken for compatibility then? (Presumably any time you change something from the Prelude, mass breakage ensues!) I'm not a big

Re: [Haskell-cafe] Stacking monads

2008-10-03 Thread Jonathan Cast
On Fri, 2008-10-03 at 12:59 -0700, Jonathan Cast wrote: On Fri, 2008-10-03 at 21:02 +0100, Andrew Coppin wrote: Jonathan Cast wrote: On Fri, 2008-10-03 at 20:43 +0100, Andrew Coppin wrote: OK. So it's broken for compatibility then? (Presumably any time you change something from

Re: [Haskell-cafe] Stacking monads

2008-10-03 Thread Jonathan Cast
On Fri, 2008-10-03 at 21:12 +0100, Andrew Coppin wrote: Brandon S. Allbery KF8NH wrote: On Oct 3, 2008, at 15:10 , Andrew Coppin wrote: Again, it looks like MonadPlus == Monad + Monoid, except all the method names are different. Why do we have this confusing duplication? Because

Re: [Haskell-cafe] Stacking monads

2008-10-02 Thread Jonathan Cast
On Thu, 2008-10-02 at 18:18 +0100, Andrew Coppin wrote: Consider the following beautiful code: run :: State - Foo - ResultSet State run_and :: State - Foo - Foo - ResultSet State run_and s0 x y = do s1 - run s0 x s2 - run s1 y return s2 run_or :: State - Foo - Foo

Re: [Haskell-cafe] Stacking monads

2008-10-02 Thread Jonathan Cast
On Thu, 2008-10-02 at 20:53 +0100, Andrew Coppin wrote: Jonathan Cast wrote: On Thu, 2008-10-02 at 18:18 +0100, Andrew Coppin wrote: After an insane amount of time making my head hurt, I disocvered that the type Either ErrorType (ResultSet State) is actually a monad. It's

Re: [Haskell-cafe] System.Process

2008-09-30 Thread Jonathan Cast
On Tue, 2008-09-30 at 18:33 +0200, Ketil Malde wrote: David Roundy [EMAIL PROTECTED] writes: Actually, it's no problem having any of those characters in your arguments, My point is that using 'words' on the argument sting to 'runProcess' and expecting the same result as 'runCommand'

Re: [Haskell-cafe] System.Process

2008-09-30 Thread Jonathan Cast
On Tue, 2008-09-30 at 09:30 -0700, Jonathan Cast wrote: On Tue, 2008-09-30 at 18:33 +0200, Ketil Malde wrote: David Roundy [EMAIL PROTECTED] writes: Actually, it's no problem having any of those characters in your arguments, My point is that using 'words' on the argument sting

Re: [Haskell-cafe] Re: 'par' - why has it the type a - b - b ?

2008-09-29 Thread Jonathan Cast
On Mon, 2008-09-29 at 17:59 +0200, Achim Schneider wrote: Malcolm Wallace [EMAIL PROTECTED] wrote: (\x y - y) *shudder* I just can't stand such things. Then call it `flip const'. jcc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: 'par' - why has it the type a - b - b ?

2008-09-29 Thread Jonathan Cast
On Mon, 2008-09-29 at 19:50 +0200, Achim Schneider wrote: Sean Leather [EMAIL PROTECTED] wrote: (\x y - y) *shudder* I just can't stand such things. What is it that you can't stand? Would you prefer flip const? It's the missing x on the right side. Makes my internal

Re: [Haskell-cafe] Re: 'par' - why has it the type a - b - b ?

2008-09-29 Thread Jonathan Cast
On Mon, 2008-09-29 at 20:34 +0200, Achim Schneider wrote: Jonathan Cast [EMAIL PROTECTED] wrote: On Mon, 2008-09-29 at 19:50 +0200, Achim Schneider wrote: Sean Leather [EMAIL PROTECTED] wrote: (\x y - y) *shudder* I just can't stand such things

Re: [Haskell-cafe] Hmm, what license to use?

2008-09-26 Thread Jonathan Cast
On Fri, 2008-09-26 at 12:17 +0200, Thomas Davie wrote: On 26 Sep 2008, at 12:12, Janis Voigtlaender wrote: Manlio Perillo wrote: When I compare GPL and MIT/BSD licenses, I do a simple reasoning. Suppose a doctor in a battle field meet a badly injuried enemy. Should he help the enemy?

Re: [Haskell-cafe] Re: Hmm, what license to use?

2008-09-26 Thread Jonathan Cast
On Fri, 2008-09-26 at 13:01 -0300, Marco Túlio Gontijo e Silva wrote: Op vrijdag 26-09-2008 om 11:45 uur [tijdzone -0400], schreef Stefan Monnier: When I compare GPL and MIT/BSD licenses, I do a simple reasoning. Suppose a doctor in a battle field meet a badly injuried enemy. Should he

Re: [Haskell-cafe] Re: Hmm, what license to use?

2008-09-26 Thread Jonathan Cast
On Fri, 2008-09-26 at 18:26 +0200, Achim Schneider wrote: Jonathan Cast [EMAIL PROTECTED] wrote: On Fri, 2008-09-26 at 13:01 -0300, Marco Túlio Gontijo e Silva wrote: Op vrijdag 26-09-2008 om 11:45 uur [tijdzone -0400], schreef Stefan Monnier: When I compare GPL and MIT/BSD

Re: [Haskell-cafe] Hmm, what license to use?

2008-09-26 Thread Jonathan Cast
On Fri, 2008-09-26 at 18:45 +0200, Thomas Davie wrote: On 26 Sep 2008, at 17:51, Jonathan Cast wrote: On Fri, 2008-09-26 at 12:17 +0200, Thomas Davie wrote: On 26 Sep 2008, at 12:12, Janis Voigtlaender wrote: Manlio Perillo wrote: When I compare GPL and MIT/BSD licenses, I do a simple

Re: [Haskell-cafe] Re: Hmm, what license to use?

2008-09-26 Thread Jonathan Cast
On Fri, 2008-09-26 at 18:50 +0200, Achim Schneider wrote: Jonathan Cast [EMAIL PROTECTED] wrote: On Fri, 2008-09-26 at 18:26 +0200, Achim Schneider wrote: Jonathan Cast [EMAIL PROTECTED] wrote: On Fri, 2008-09-26 at 13:01 -0300, Marco Túlio Gontijo e Silva wrote: Op

Re: [Haskell-cafe] Re: Hmm, what license to use?

2008-09-26 Thread Jonathan Cast
On Fri, 2008-09-26 at 09:48 -0700, Jonathan Cast wrote: On Fri, 2008-09-26 at 18:50 +0200, Achim Schneider wrote: Jonathan Cast [EMAIL PROTECTED] wrote: On Fri, 2008-09-26 at 18:26 +0200, Achim Schneider wrote: Jonathan Cast [EMAIL PROTECTED] wrote: On Fri, 2008-09-26 at 13

Re: [Haskell-cafe] The container problem

2008-09-26 Thread Jonathan Cast
On Fri, 2008-09-26 at 15:25 -0700, Jason Dusek wrote: Can someone explain, why is it that Set can not be a Monad? It can't even be a functor (which all monads are). You can't implement fmap (+) $ Set.fromList [1, 2, 3] with Data.Set, because you can't order functions of type Integer -

Re: [Haskell-cafe] [m..n] question

2008-09-26 Thread Jonathan Cast
On Sat, 2008-09-27 at 02:09 +0100, Simon Richard Clarkstone wrote: Darn, I sent this as personal mail the first time. Evan Laforge wrote: In Haskell, The sequence enumFromTo e1 e3 is the list [e1,e1+1,e1+2,...e3]. The list is empty if e1 e3. I like it, since it means that things

Re: [Haskell-cafe] Random question

2008-09-24 Thread Jonathan Cast
On Wed, 2008-09-24 at 22:44 +0100, Iain Barnett wrote: On 24 Sep 2008, at 10:13 pm, Evan Laforge wrote: For one approach, check out 'replicate' to make copies of something, and then 'sequence' to run them and return a list. Thanks, I haven't found anything that explains 'sequence' well

Re: Re[8]: [Haskell-cafe] Climbing up the shootout...

2008-09-22 Thread Jonathan Cast
On Tue, 2008-09-23 at 00:20 +0400, Bulat Ziganshin wrote: Hello Isaac, Monday, September 22, 2008, 11:49:30 PM, you wrote: i mean that naive haskell code is very slow and 3 or 5 or twelve libs can't solve the problem of ghc generating slow code Is there something particularly

Re: Re[10]: [Haskell-cafe] Climbing up the shootout...

2008-09-22 Thread Jonathan Cast
On Tue, 2008-09-23 at 00:46 +0400, Bulat Ziganshin wrote: Hello Jonathan, Tuesday, September 23, 2008, 12:30:19 AM, you wrote: yes, in asm number of instructions executed more or less define number of CPU cycles used. well, i more or less know all this stuff. but are you

Re: [Haskell-cafe] Lazy vs correct IO [Was: A round of golf]

2008-09-19 Thread Jonathan Cast
On Fri, 2008-09-19 at 16:30 +0100, Lennart Augustsson wrote: I agree that lazy IO is a can with some worms in it. But it's not that strange. The readFile operation is in the IO monad, so it has an effect on the world. This effect is not finished when readFile returns, and from the world

[Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?

2008-09-18 Thread Jonathan Cast
On Thu, 2008-09-18 at 10:33 +0100, Simon Marlow wrote: Jonathan Cast wrote: An OS thread (Linux/Plan 9) stores: * Stack (definitely a stack pointer and stored registers ( 40 bytes on i686) and includes a special set of page tables on Plan 9) * FD set (even if it's the same

Re: [Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?

2008-09-17 Thread Jonathan Cast
On Wed, 2008-09-17 at 18:40 +, Aaron Denney wrote: On 2008-09-17, Arnar Birgisson [EMAIL PROTECTED] wrote: Hi Manlio and others, On Wed, Sep 17, 2008 at 14:58, Manlio Perillo [EMAIL PROTECTED] wrote:

Re: [Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?

2008-09-17 Thread Jonathan Cast
On Wed, 2008-09-17 at 20:29 +, Aaron Denney wrote: On 2008-09-17, Jonathan Cast [EMAIL PROTECTED] wrote: On Wed, 2008-09-17 at 18:40 +, Aaron Denney wrote: On 2008-09-17, Arnar Birgisson [EMAIL PROTECTED] wrote: Hi Manlio and others, On Wed, Sep 17, 2008 at 14:58, Manlio

Re: [Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?

2008-09-17 Thread Jonathan Cast
On Wed, 2008-09-17 at 13:44 -0700, Evan Laforge wrote: systems that don't use an existing user-space thread library (such as Concurrent Haskell or libthread [1]) emulate user-space threads by keeping a pool of processors and re-using them (e.g., IIUC Apache does this). Your response

Re: [Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?

2008-09-17 Thread Jonathan Cast
On Wed, 2008-09-17 at 23:42 +0200, Arnar Birgisson wrote: On Wed, Sep 17, 2008 at 23:20, Aaron Denney [EMAIL PROTECTED] wrote: The central aspect in my mind is a default share-everything, or default share-nothing. [..snip...] These are, in fact, process models. They are implemented on

Threads vs. processes [Was: Re: [Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?]

2008-09-17 Thread Jonathan Cast
On Wed, 2008-09-17 at 21:20 +, Aaron Denney wrote: On 2008-09-17, Jonathan Cast [EMAIL PROTECTED] wrote: In my mind pooling vs new-creation is only relevant to process vs thread in the performance aspects. Say what? This discussion is entirely about performance --- does CPython

Re: [Haskell-cafe] Re: Windows details

2008-09-12 Thread Jonathan Cast
On Fri, 2008-09-12 at 18:07 +0100, Andrew Coppin wrote: Bulat Ziganshin wrote: Hello Andrew, Thursday, September 11, 2008, 11:24:24 PM, you wrote: interestingly, XN seems to make GHC-compiled binary files dramatically *smaller*... huh??) probably it does `strip` on

Re: [Haskell-cafe] Re: Windows details

2008-09-12 Thread Jonathan Cast
On Fri, 2008-09-12 at 18:35 +0100, Andrew Coppin wrote: Jonathan Cast wrote: On Fri, 2008-09-12 at 18:07 +0100, Andrew Coppin wrote: And what exactly does a strip mean, then? Remove the symbol table. And, for C, other debugging information. Historically, I believe

Re: [Haskell-cafe] typeclass question

2008-09-11 Thread Jonathan Cast
On Thu, 2008-09-11 at 13:23 +0200, Johannes Waldmann wrote: Well, it's a library that others might use, so I would prefer to avoid using language extensions, especially functional deps which I don't understand, and which seem to have an uncertain future. I think there will be a storm of

Re: [Haskell-cafe] typeclass question

2008-09-11 Thread Jonathan Cast
On Thu, 2008-09-11 at 18:34 +0200, Johannes Waldmann wrote: if support for this simple shape of dependencies ( ... | a - b ) ... For backwards-compatibility reasons, Yes. This gives point, then, to my concerns about letting Haskell become a practical language. At some point,

Re: [Haskell-cafe] Re: Field names

2008-09-10 Thread Jonathan Cast
On Wed, 2008-09-10 at 11:54 -0400, Brandon S. Allbery KF8NH wrote: On 2008 Sep 10, at 8:53, Bulat Ziganshin wrote: Wednesday, September 10, 2008, 4:07:41 PM, you wrote: Do you have any reference for that use of infixing constructors by start their name with ':'? That's interesting, and I

Re: [Haskell-cafe] Re: Field names

2008-09-10 Thread Jonathan Cast
On Wed, 2008-09-10 at 21:32 -0300, Mauricio wrote: Do you have any reference for that use of infixing constructors by start their name with ':'? (...) (...) for data constructors, go to http://haskell.org/onlinereport/lexemes.html and search for `Operator symbols'. (...)

Re: [Haskell-cafe] Windows console

2008-09-09 Thread Jonathan Cast
On Tue, 2008-09-09 at 20:15 +0100, Andrew Coppin wrote: When coding in a POSIX-compliant environment, you can usually write special escape codes to the console to change the text colour and so forth. However, this does not work on Windows. (Ignore all references you see to enabling

Re: [Haskell-cafe] Compiler's bane

2008-09-04 Thread Jonathan Cast
On Thu, 2008-09-04 at 18:41 +0100, Andrew Coppin wrote: Ryan Ingram wrote: It's pretty simple, I think. type ExpGen = ReaderT [String] Gen arbExp :: ExpGen Expression -- exercise for the reader instance Arbitrary Expression where arbitrary = runReaderT arbExp []

Re: [Haskell-cafe] What monad am I in?

2008-09-02 Thread Jonathan Cast
On Tue, 2008-09-02 at 20:25 +, Henry Laxen wrote: Dear Group, When I fire up ghci and define: increment x = return (x+1) I can say: Main increment 1 and ghci dutifully replies 2. Also as expected, the type signature of increment is: (Num a, Monad m) = a - m a However, if I

Re: [Haskell-cafe] Research language vs. professional language

2008-09-01 Thread Jonathan Cast
On Mon, 2008-09-01 at 01:20 -0700, Don Stewart wrote: ryani.spam: On Sun, Aug 31, 2008 at 7:27 PM, Jonathan Cast [EMAIL PROTECTED] wrote: This concept of `day-to-day work' is a curious one. Haskell is not a mature language, and probably shouldn't ever be one. I see where you

[Haskell-cafe] Re: Research language vs. professional language

2008-09-01 Thread Jonathan Cast
On Mon, 2008-09-01 at 01:07 -0700, Ryan Ingram wrote: Jonathan, I think we are going to end up just disagreeing on this subject, but I'd like to point out the reasons why we disagree. On Sun, Aug 31, 2008 at 7:27 PM, Jonathan Cast [EMAIL PROTECTED] wrote: This concept of `day-to-day work

Re: [Haskell-cafe] Compiler's bane

2008-08-31 Thread Jonathan Cast
On Sun, 2008-08-31 at 17:29 +0100, Andrew Coppin wrote: Ryan Ingram wrote: On Sun, Aug 31, 2008 at 12:46 AM, Andrew Coppin [EMAIL PROTECTED] wrote: Right. So if I have, say, the factorial function defined using the Y combinator, there's no way to stop the interpretter expanding an

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Jonathan Cast
On Sun, 2008-08-31 at 16:08 -0700, Ryan Ingram wrote: In particular I do NOT want each function in its own typeclass; the previous post saying: foo x = map (bar x) should be rejected as ambiguous without a type signature somewhere What type signature do you propose? It seems as if you're

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Jonathan Cast
On Sun, 2008-08-31 at 19:06 -0700, Ryan Ingram wrote: On Sun, Aug 31, 2008 at 4:21 PM, Jonathan Cast [EMAIL PROTECTED] wrote: It seems as if you're proposing that doubleSet :: Set.Set Int - Set.Set Int doubleSet = map (*2) doubleList :: [Int] - [Int] doubleList :: map (*2

Re: [Haskell-cafe] Compiler's bane

2008-08-29 Thread Jonathan Cast
On Fri, 2008-08-29 at 20:56 +0100, Andrew Coppin wrote: Neil Mitchell wrote: Hi I'm writing a simple interpretter for a small extended-lambda-calculus sort of language. And I'd just like to say... RECURSIVE LET-BINDS! GH!!! _ Agreed :-) I'm glad it's not just

Re: [Haskell-cafe] Compiler's bane

2008-08-29 Thread Jonathan Cast
On Fri, 2008-08-29 at 21:48 +0100, Conor McBride wrote: Hi On 29 Aug 2008, at 21:12, Jonathan Cast wrote: If you want to avoid infinite normal forms (or just plain lack of normal forms, as in let x = x in x or (\x - x x) (\ x - x x)), you need to follow three rules: 1) Static

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-28 Thread Jonathan Cast
On Thu, 2008-08-28 at 10:00 +0100, Adrian Hey wrote: Lennart Augustsson wrote: I don't don't think global variables should be banned, I just think they should be severly discouraged. If you're saying a language should not provide a sound way to do this (as I believe you are), then

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-28 Thread Jonathan Cast
On Thu, 2008-08-28 at 22:24 +0100, Adrian Hey wrote: Jonathan Cast wrote: This has been answered repeatedly, at least implicitly. Unless you insist that getWhatever should live in the IO monad and have no functional arguments (why?), there is no reason why this should be impossible

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-28 Thread Jonathan Cast
On Thu, 2008-08-28 at 14:45 -0700, Jonathan Cast wrote: On Thu, 2008-08-28 at 22:24 +0100, Adrian Hey wrote: Jonathan Cast wrote: This has been answered repeatedly, at least implicitly. Unless you insist that getWhatever should live in the IO monad and have no functional arguments

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 11:53 +0100, Adrian Hey wrote: John Meacham wrote: As with all design decisions, it is sometimes the right thing and sometimes the wrong one. And sometimes the most expedient. (which, occasionally, is a perfectly valid driving force behind a certain bit of coding).

Re: [Haskell-cafe] Haskell symbol ~

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 20:14 +0100, C.M.Brown wrote: Hi, I may be wrong here, but I don't belive it's just let-patterns that have this property. I.e. what's the difference between... (Just x) = _|_ f = x vs. f = let (Just x) = _|_ in x vs. f = x where (Just x) = _|_ I

Re: [Haskell-cafe] Haskell Propeganda

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 12:23 -0700, Dan Weston wrote: Tim Docker wrote: David Roundy wrote: Which illustrates the point that it's not type safety that protects us from segfaults, so much as bounds checking, and that's got a non-trivial runtime cost. At least, most segfaults that

Re: [Haskell-cafe] Haskell Propeganda

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 13:34 -0700, Aaron Tomb wrote: On Aug 27, 2008, at 12:23 PM, Dan Weston wrote: Huh? Type safety buys you not having to worry about dereferencing stale nonnull pointers (lifetime of reference exceeding lifetime of referent), but nothing about dereferencing null

Re: Re[2]: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-27 Thread Jonathan Cast
On Thu, 2008-08-28 at 00:53 +0400, Bulat Ziganshin wrote: Hello Jonathan, Wednesday, August 27, 2008, 8:12:42 PM, you wrote: * I wonder why that name was chosen? The design doesn't seem to have anything to do with IO, it's more of a `we have this in C so we want it in Haskell too'

Re: Re[4]: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-27 Thread Jonathan Cast
On Thu, 2008-08-28 at 01:09 +0400, Bulat Ziganshin wrote: Hello Jonathan, Thursday, August 28, 2008, 12:57:19 AM, you wrote: s/it/exchange with external world, i.e., essentially, I/O/ Bald assertion. I don't buy it. What do IORefs have to do with exchange with the external world?

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 23:20 +0200, Daniel Fischer wrote: Am Mittwoch, 27. August 2008 22:57 schrieb Jonathan Cast: On Thu, 2008-08-28 at 00:53 +0400, Bulat Ziganshin wrote: Hello Jonathan, Wednesday, August 27, 2008, 8:12:42 PM, you wrote: * I wonder why that name was chosen

Re: Re[6]: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-27 Thread Jonathan Cast
On Thu, 2008-08-28 at 01:23 +0400, Bulat Ziganshin wrote: Hello Jonathan, Thursday, August 28, 2008, 1:11:35 AM, you wrote: IORefs got their names because they are implemented in IO monad :) But why are they implemented in the IO monad? because they need its features. but i/o may be

Re: Re[6]: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 14:50 -0700, Jonathan Cast wrote: On Thu, 2008-08-28 at 01:23 +0400, Bulat Ziganshin wrote: Hello Jonathan, Thursday, August 28, 2008, 1:11:35 AM, you wrote: IORefs got their names because they are implemented in IO monad :) But why are they implemented

Re: Re[6]: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 23:00 +0100, Lennart Augustsson wrote: IMO, there's no justification for having IORefs etc in the IO monad. They should be in a separate monad. There could then be an operation to lift that monad to the IO monad, if you so wish. But wait, we already have that, it's the

Re: [Haskell-cafe] can the default instances in GHC be recompiled with overlap?

2008-08-25 Thread Jonathan Cast
On Mon, 2008-08-25 at 15:44 -0700, Jason Dusek wrote: Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: Jason Dusek wrote: It is inconvenient for certain things. If I want to declare a special `instance Show [MyType] where...` I am out of luck. In this particular case, can't you

Re: [Haskell-cafe] Show me

2008-08-08 Thread Jonathan Cast
On Wed, 2008-08-06 at 19:06 +0100, Andrew Coppin wrote: Jonathan Cast wrote: instance Show x = Show (Foo x) where showsPrec n foo = (list_foo ++) . shows (foo_list foo) You use the n parameter if you've got an infix operator in your syntax and you want to put parentheses around

Re: [Haskell-cafe] adjunction of product and exponentiation

2008-08-07 Thread Jonathan Cast
On Wed, 2008-08-06 at 22:50 -0700, Jason Dusek wrote: Jonathan Cast [EMAIL PROTECTED] wrote: Jason Dusek wrote: It is an arrow that takes a C to an arrow that takes an A and makes the product C x A. I want to write curry(C x A) but that is ridiculous looking. What's the right notation

Re: [Haskell-cafe] Last Call for the Italian Haskellers Summer Meeting

2008-08-07 Thread Jonathan Cast
On Thu, 2008-08-07 at 10:35 -0700, Dan Weston wrote: Shouldn't that be posta elettronica (or posteletta along the lines of the Frence courriel)? eposta, surely... jcc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] the Haskell with pattern?

2008-08-06 Thread Jonathan Cast
On Wed, 2008-08-06 at 18:21 +0200, Johan Tibell wrote: On Wed, Aug 6, 2008 at 5:44 PM, Jules Bean [EMAIL PROTECTED] wrote: Johan Tibell wrote: You probably knew this already but there's nothing in the with idiom that prevents the resource to escape. And, it doesn't always matter. Some

Re: [Haskell-cafe] adjunction of product and exponentiation

2008-08-06 Thread Jonathan Cast
On Wed, 2008-08-06 at 13:56 -0700, Jason Dusek wrote: The problem as stated is to find the unit for the adjunction: ((- x A), (-)^A x A) The latter functor takes an arrow f to (f . -) x id_A and does the obvious thing for objects. The co-unit diagram is given as:

Re: [Haskell-cafe] Show me

2008-08-05 Thread Jonathan Cast
On Tue, 2008-08-05 at 20:28 +0100, Andrew Coppin wrote: Suppose we have the following: data Foo x list_foo :: [x] - Foo x foo_list :: Foo x - [x] What would be the best way to write a Show instance? The thing that I came up with is instance (Show x) = Show (Foo x) where

Re: [Haskell-cafe] Capitalization and associated type families

2008-08-04 Thread Jonathan Cast
On Mon, 2008-08-04 at 19:51 +0100, Brian Hulley wrote: Hi, I'm familiar with the capitalization rules for identifiers in Haskell and know that they are very useful and practical e.g. by allowing variables to be distinguished from constants in patterns etc. However I'm trying to understand

Re: [Haskell-cafe] Capitalization and associated type families

2008-08-04 Thread Jonathan Cast
On Mon, 2008-08-04 at 23:04 +0100, Brian Hulley wrote: Jonathan Cast wrote: On Mon, 2008-08-04 at 19:51 +0100, Brian Hulley wrote: For example, why is there any distinction between a type variable and a type constant? forall a b. (a - b) - List a - List b Now this begs

Re: [Haskell-cafe] Existential quantification problem

2008-07-13 Thread Jonathan Cast
On Sun, 2008-07-13 at 18:28 -0500, Derek Elkins wrote: On Thu, 2008-07-10 at 10:59 -0700, Jonathan Cast wrote: On Thu, 2008-07-10 at 14:53 -0300, Marco Túlio Gontijo e Silva wrote: Hello, how do I unbox a existential quantificated data type? You can't. You have to use case

Re: [Haskell-cafe] Existential quantification problem

2008-07-13 Thread Jonathan Cast
On Sun, 2008-07-13 at 21:03 -0400, Brandon S. Allbery KF8NH wrote: On 2008 Jul 13, at 19:50, Jonathan Cast wrote: On Sun, 2008-07-13 at 18:28 -0500, Derek Elkins wrote: On Thu, 2008-07-10 at 10:59 -0700, Jonathan Cast wrote: On Thu, 2008-07-10 at 14:53 -0300, Marco Túlio Gontijo e Silva

Re: [Haskell-cafe] More idiomatic use of strictness

2008-07-10 Thread Jonathan Cast
On Thu, 2008-07-10 at 03:16 -0700, Grzegorz Chrupala wrote: Hi all, Is there a less ugly way of avoiding laziness in the code pasted below then the use of seq in the last line? The program is supposed to split a large input file into chunks and check in how many of those chunks each of a

Re: [Haskell-cafe] Existential quantification problem

2008-07-10 Thread Jonathan Cast
On Thu, 2008-07-10 at 14:53 -0300, Marco Túlio Gontijo e Silva wrote: Hello, how do I unbox a existential quantificated data type? You can't. You have to use case analysis: case foo of L l - whatever you wanted to do where none of the information your case analysis discovers about

Re: [Haskell-cafe] Qualified import syntax badly designed (?)

2008-07-09 Thread Jonathan Cast
On Wed, 2008-07-09 at 12:36 +0200, Henning Thielemann wrote: On Wed, 9 Jul 2008, Neil Mitchell wrote: For example, in the module I'm currently working on: module Hoogle.DataBase.TypeSearch.Graph( Graph, newGraph, GraphResult(..), ArgPos, Binding, graphSearch ) where

Re: [Haskell-cafe] parsec manyTill stack overflow

2008-07-04 Thread Jonathan Cast
On Fri, 2008-07-04 at 15:15 -0700, Badea Daniel wrote: The file I'm trying to parse contains mixed sections like: ... start_section= ... script including arithmetic expressions ... /end_section ... so I defined two parsers: one for the 'outer' language and the other one for

Re: [Haskell-cafe] Re: POSIX AIO (asych I/O) ...

2008-07-02 Thread Jonathan Cast
On Wed, 2008-07-02 at 02:07 -0400, Brandon S. Allbery KF8NH wrote: On 2008 Jul 2, at 1:42, Galchin, Vasili wrote: errno - throwErrnoIfMinus1 aioError (c_aio_error p_aiocb) ghc thinks that Errno should be an instance of Num: System/Posix/Aio.hsc:117:15: No instance for

Re: [Haskell-cafe] Re: POSIX AIO (asych I/O) ...

2008-07-02 Thread Jonathan Cast
On Wed, 2008-07-02 at 02:17 -0400, Brandon S. Allbery KF8NH wrote: On 2008 Jul 2, at 2:15, Jonathan Cast wrote: It seems as though it can return -1 if given non-sensical input. But in The POSIX spec says it returns EINVAL in that case. Are you sure? A little googling picks up e.g

Re: Re[Haskell-cafe] [2]: Help with generalizing function

2008-06-23 Thread Jonathan Cast
On Mon, 2008-06-23 at 04:03 -0700, leledumbo wrote: Don't give up so fast !! (Note that you can't do what you asked for in Pascal either, in fact Pascal don't support n-uplet) I'm not going to use n-uplet, dynamic array of array of Byte is enough. Though not very optimizing, I can use 2

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Jonathan Cast
On Tue, 2008-06-17 at 18:45 +0200, Karoly Negyesi wrote: Hi, The PHP community is discussing the adding of closures and lambdas to the language, see the proposal at http://wiki.php.net/rfc/closures If someone with knowledge of both languages could take a quick look it would be great. I

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Jonathan Cast
On Wed, 2008-06-18 at 06:36 +0200, Karoly Negyesi wrote: (a) I would *never* want to use an implementation of closures like that. (b) Closures as proposed are *far* better than not having closures. Could you elaborate on a) ? I dislike the habit of implicit declaration --- strongly ---

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Jonathan Cast
On Wed, 2008-06-18 at 16:00 +0100, PR Stanley wrote: It seems to me that if a PHP developer sees the Haskell community as a resource for advice on programming language implementation, we should take this as a compliment to the Haskell community. Repaying that compliment with your language

Re: [Haskell-cafe] monomorphism restriction

2008-06-14 Thread Jonathan Cast
On Sat, 2008-06-14 at 17:19 +1000, Rafal Kolanski wrote: Ryan Ingram wrote: sumns 0 = 0 sumns x = sumns (x-1) + n Without the monomorphism restriction, computing n is a function call; it is evaluated each time it is asked for. I'm relatively new to Haskell, and since this topic

Re: [Haskell-cafe] monomorphism restriction

2008-06-13 Thread Jonathan Cast
On Wed, 2008-06-11 at 20:24 -0700, Don Stewart wrote: page: Definition of f: f = foldr (+) 0 Types: 0 :: (Num t) = t foldr (+) 0 :: Num a = [a] - a f :: [Integer] - Integer Please remind me, again, of the advantages of f being something different from the formula

Re: [Haskell-cafe] automatically deriving Map and Filter on datatypes etc.

2008-06-05 Thread Jonathan Cast
On 5 Jun 2008, at 1:39 AM, Thomas Davie wrote: Even deriving an instance of Functor seems rather implausable, what should it do for data Wierd a b = Nil | A a (Wierd a b) | B b (Wierd a b) Should fmap's function argument operate on 'a's, 'b's, or both? class Functor (f :: * - *) where ...

Re: [Haskell-cafe] Parsec, updateState, and failure

2008-05-31 Thread Jonathan Cast
On 31 May 2008, at 7:12 AM, Dimitry Golubovsky wrote: Hi, If a parser which updated user state fails, will such update be reverted? Suppose we have two parsers combined with | p = p1 | p2 p1 has the following: p1 = try $ do ... -- getting something from the input stream updateState

Re: [Haskell-cafe] modelling C in Haskell ..

2008-05-30 Thread Jonathan Cast
On 29 May 2008, at 11:46 PM, Galchin, Vasili wrote: Hello, I don't want to write kludgy Haskell code! typedef struct blah { int val1; union { int val2; struct { int val3; int val4; } } }

Re: [Haskell-cafe] modelling C in Haskell ..

2008-05-30 Thread Jonathan Cast
On 30 May 2008, at 12:29 AM, Galchin, Vasili wrote: compactness in writing and also namespace pollution .. ;^) I know what the advantages of C's notation are. But getting the best notation out of Haskell generally doesn't happen by trying to make your code look like C. So the general

Re: [Haskell-cafe] So how do people pronounce 'cabal' around here?

2008-05-29 Thread Jonathan Cast
On 29 May 2008, at 10:44 AM, Dan Piponi wrote: On Wed, May 28, 2008 at 6:38 PM, Richard A. O'Keefe [EMAIL PROTECTED] wrote: I've always pronounced it k'BAHL, but was surprised to find that the OED only countenances a short second syllable: The reason I originally asked is that American,

Re: [Haskell-cafe] bottomless Top?

2008-05-15 Thread Jonathan Cast
On 15 May 2008, at 4:29 AM, Conor McBride wrote: Replying slap-foreheadedly to own post... On 15 May 2008, at 11:56, Conor McBride wrote: Folks I'm also wondering whether it makes sense to have a bottomless Top type, with constructor _ and lazy pattern _ (with (undefined :: Top) equal to

Re: [Haskell-cafe] Re: Endianess

2008-05-14 Thread Jonathan Cast
On 14 May 2008, at 2:13 PM, Claus Reinke wrote: It's not that simple with bits. They lack consistency just like the usual US date format and the way Germans read numbers. So you claim that you pronounce 14 tenty-four? In German pronunciation is completely uniform from 13 to 99.

Re: [Haskell-cafe] I hate Haskell's typeclasses

2008-04-22 Thread Jonathan Cast
On 22 Apr 2008, at 8:03 PM, Derek Elkins wrote: On Mon, 2008-04-21 at 22:58 -0700, Jonathan Cast wrote: class Forceable alpha where seq :: alpha - beta - beta Instances derived automatically by the compiler, when possible, for every type (like Typeable should be). We can omit functions

Re: [Haskell-cafe] I hate Haskell's typeclasses

2008-04-22 Thread Jonathan Cast
On 22 Apr 2008, at 9:53 AM, Ryan Ingram wrote: On Mon, Apr 21, 2008 at 10:58 PM, Jonathan Cast [EMAIL PROTECTED] wrote: I must have failed to communicate well. To me, the point of giving a class a name is that then you can write a program that is parametric over the elements of that class

Re: [Haskell-cafe] I hate Haskell's typeclasses

2008-04-21 Thread Jonathan Cast
On 21 Apr 2008, at 12:50 AM, Ryan Ingram wrote: On Fri, Apr 18, 2008 at 10:01 PM, Jonathan Cast [EMAIL PROTECTED] wrote: {-# GHC_OPTIONS -foverlapping-instances -fundecidable-instances #-} :) What you want to work is precisely what this allows. Of course, I bring that point up

Re: [Haskell-cafe] I hate Haskell's typeclasses

2008-04-20 Thread Jonathan Cast
On 20 Apr 2008, at 3:05 AM, David MacIver wrote: On Sun, Apr 20, 2008 at 4:46 AM, Jonathan Cast [EMAIL PROTECTED] wrote: On 19 Apr 2008, at 5:02 AM, David MacIver wrote: Independently of the rant... On Sat, Apr 19, 2008 at 6:01 AM, Jonathan Cast [EMAIL PROTECTED] wrote: But why do I need

Re: [Haskell-cafe] I hate Haskell's typeclasses

2008-04-19 Thread Jonathan Cast
On 19 Apr 2008, at 5:02 AM, David MacIver wrote: Independently of the rant... On Sat, Apr 19, 2008 at 6:01 AM, Jonathan Cast [EMAIL PROTECTED] wrote: But why do I need to jump through these hoops for a perfectly safe commonly desired operation? It's called a proof obligation. Haskell

Re: [Haskell-cafe] I hate Haskell's typeclasses

2008-04-18 Thread Jonathan Cast
On 18 Apr 2008, at 9:29 PM, Ryan Ingram wrote: WARNING: RANT AHEAD. WARNING: RESPONSE IN THE SPIRIT OF THE ORIGINAL AHEAD. Hopefully this fires off some productive discussion on how to fix these problems! {-# GHC_OPTIONS -foverlapping-instances -fundecidable-instances #-} :) What you

<    1   2   3   4   5   6   >