Re: [Haskell-cafe] Before

2007-07-03 Thread Henning Thielemann
On Mon, 2 Jul 2007, Jonathan Cast wrote: On Monday 02 July 2007, Andrew Coppin wrote: What were monads like before they became a Haskell language construct? Is Haskell's idea of a monad actually anywhere close to the original mathematical formalism? Just being randomly curiose...

Re[2]: [Haskell-cafe] Re: Parsers are monadic?

2007-07-03 Thread Bulat Ziganshin
Hello Gregory, Tuesday, July 3, 2007, 1:02:44 AM, you wrote: Right, I read more about it and found this out.  The 'main' function is apparently magical at runtime and allows you to break i recommend you to read two htmls:

Re: [Haskell-cafe] Getting debugging/logging info?

2007-07-03 Thread Jules Bean
Hugh Perkins wrote: In imperative languages we can do this type of thing: SystemLogging.LogInfo(About to do something...); DoSomething(); SystemLogging.LogInfo(Did Something); SystemLogging.LogInfo(x is + x ); This is what the Writer Monad is for, probably. Jules

[Haskell-cafe] Haskell's currying versus Business Objects Gem Cutter's burning

2007-07-03 Thread peterv
In Haskell, currying can only be done on the last (rightmost) function arguments. So foo x y can be curried as foo x but not as foo ? y where ? would be a wilcard for the x parameter. In Haskell, one must write a new function foo2 y x = foo x y and then

Re: [Haskell-cafe] Haskell's currying versus Business Objects Gem Cutter's burning

2007-07-03 Thread Dougal Stanton
On 03/07/07, peterv [EMAIL PROTECTED] wrote: In Haskell, currying can only be done on the last (rightmost) function arguments. So foo x y can be curried as foo x but not as foo ? y where ? would be a wilcard for the x parameter. The function flip can be used in

Re: [Haskell-cafe] Haskell's partial application (not currying!) versus Business Objects Gem Cutter's burning

2007-07-03 Thread Jules Bean
peterv wrote: In Haskell, currying can only be done on the last (rightmost) function arguments. You are talking about partial application, not currying. foo x y can be curried as foo x but not as foo ? y where ? would be a “wilcard” for the x parameter. (\x - foo x y) [snip] This

Re: [Haskell-cafe] Haskell's

2007-07-03 Thread Peter Verswyvelen
Ah, thanks for the correction. So if I understand it correctly, this is currying: when f :: (a,b) - c then g :: a - (b,c) is the curried form of f? So currying has to do with tuples? And partial application is just leaving away some tail arguments? - Oorspronkelijk bericht -

Re: [Haskell-cafe] Haskell's currying versus Business Objects Gem Cutter's burning

2007-07-03 Thread Bulat Ziganshin
Hello peterv, Tuesday, July 3, 2007, 1:40:11 PM, you wrote: This burning looks more general to me, but cannot be done using the textual approach? it's just a matter of syntax :) foo ? bar may be replaced with \x - foo x bar although i agree that burning syntax is useful. one problem that

Re: [Haskell-cafe] Haskell's

2007-07-03 Thread Jules Bean
Peter Verswyvelen wrote: Ah, thanks for the correction. So if I understand it correctly, this is currying: when f :: (a,b) - c then g :: a - (b,c) is the curried form of f? So currying has to do with tuples? g :: a - b - c (also could be written as g :: a - (b - c) ) is the curried

Re: [Haskell-cafe] Haskell's

2007-07-03 Thread Henning Thielemann
On Tue, 3 Jul 2007, Peter Verswyvelen wrote: Ah, thanks for the correction. So if I understand it correctly, this is currying: when f :: (a,b) - c then g :: a - (b,c) is the curried form of f? No it is g :: a - b - c g = curry f So currying has to do with tuples? Yes. And

Re: [Haskell-cafe] Haskell's

2007-07-03 Thread Ilya Tsindlekht
On Tue, Jul 03, 2007 at 10:53:33AM +, Peter Verswyvelen wrote: Ah, thanks for the correction. So if I understand it correctly, this is currying: when f :: (a,b) - c then g :: a - (b,c) g :: a-b-c is the curried form of f? So currying has to do with tuples? And partial

Re: [Haskell-cafe] Haskell's currying and partial application

2007-07-03 Thread Henning Thielemann
On Tue, 3 Jul 2007, Peter Verswyvelen wrote: Ah, thanks for the correction. So if I understand it correctly, this is currying: See also: http://haskell.org/haskellwiki/Currying http://haskell.org/haskellwiki/Partial_application and more generally:

[Haskell-cafe] Two-continuation `monads' and MonadMinus [Re: Parsers are monadic?]

2007-07-03 Thread oleg
When designing the full Kanren, we have experimented with two-continuation actions and various plumbing combinators (any, all, deterministic-all, etc). We eventually gave up on this after we realized that a simple interface suffices. Called MonadMinus, it is capable of defining LogicT monad with

Re: [Haskell-cafe] Haskell's currying and partial application

2007-07-03 Thread Peter Verswyvelen
Duh, I made a typo in my previous emails, I did mean a - (b - c) and not a - (b,c). But you guys quickly corrected that IMHO when reading http://haskell.org/haskellwiki/Currying a newbie like me cannot see the difference between currying and partial application... I quote the text:

Re: [Haskell-cafe] Haskell's currying and partial application

2007-07-03 Thread Henning Thielemann
On Tue, 3 Jul 2007, Peter Verswyvelen wrote: IMHO when reading http://haskell.org/haskellwiki/Currying a newbie like me cannot see the difference between currying and partial application... Better now? ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Haskell's currying and partial application

2007-07-03 Thread Jules Bean
Henning Thielemann wrote: On Tue, 3 Jul 2007, Peter Verswyvelen wrote: IMHO when reading http://haskell.org/haskellwiki/Currying a newbie like me cannot see the difference between currying and partial application... Better now? Much better, IMO, although I still don't like the part with

Re: [Haskell-cafe] Before

2007-07-03 Thread Jonathan Cast
On Tuesday 03 July 2007, you wrote: On Mon, 2 Jul 2007, Jonathan Cast wrote: On Monday 02 July 2007, Andrew Coppin wrote: What were monads like before they became a Haskell language construct? Is Haskell's idea of a monad actually anywhere close to the original mathematical

Re: [Haskell-cafe] Before

2007-07-03 Thread Jonathan Cast
On Tuesday 03 July 2007, you wrote: On Mon, 2 Jul 2007, Jonathan Cast wrote: On Monday 02 July 2007, Andrew Coppin wrote: What were monads like before they became a Haskell language construct? Is Haskell's idea of a monad actually anywhere close to the original mathematical

[Haskell-cafe] Sparse documentation

2007-07-03 Thread Andrew Coppin
Is there a reason why the documentation for virtually every module in Control.Monad simply begins with a line that says Inspired by some paper (http://www.ogi.edu/csee/~mpj/) and then just shows you a bunch of type signatures, without telling you *anything* about what the module is supposed

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread Brent Yorgey
Is there a reason why the documentation for virtually every module in Control.Monad simply begins with a line that says Inspired by some paper (http://www.ogi.edu/csee/~mpj/) It's probably because it was felt that the paper itself is better documentation than anything that could be written

RE: [Haskell-cafe] Haskell's currying and partial application

2007-07-03 Thread Peter Verswyvelen
Much better. Although I struggle a bit with the exercises ;) Let's see id :: a - a curry :: ((a,b) - c) - a - b - c = curry id :: ((a,b) - (a,b)) - a - b - (a,b) So basically if f = curry id then f x y = (x,y) which means curry id = (,) something like this? Do I win a price now? ;)

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread Tim Newsham
Is there a particular module you're having trouble with? Or just griping in general? =) How about STM? It would be nice if I didn't have to scan the paper each time I do something with STM. Isn't that the point of having an API reference? -Brent Tim Newsham

RE: [Haskell-cafe] Haskell's currying and partial application

2007-07-03 Thread Henning Thielemann
On Tue, 3 Jul 2007, Peter Verswyvelen wrote: Let's see id :: a - a curry :: ((a,b) - c) - a - b - c = curry id :: ((a,b) - (a,b)) - a - b - (a,b) So basically if f = curry id then f x y = (x,y) which means curry id = (,) something like this? You got it! Do I win a price

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread Duncan Coutts
On Tue, 2007-07-03 at 15:11 -0400, Brent Yorgey wrote: Is there a reason why the documentation for virtually every module in Control.Monad simply begins with a line that says Inspired by some paper (http://www.ogi.edu/csee/~mpj/) It's probably

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread Claus Reinke
the references have not been updated, it seems. but once you've used the name Mark P Jones, mentioned next to the link, to google for a current url for his publications page, you'll (a) find a treasure-trove of haskell papers http://web.cecs.pdx.edu/~mpj/ (b) be able to submit a fix for

Re: [Haskell-cafe] sha1 implementation thats only 12 times slower then C

2007-07-03 Thread Anatoly Yakovenko
inlining some of the functions definitely gave me a boost, so i am about 8.5 times slower then openssl sha1sum. I dont really understand the core output, but after inlining i got a completely different profile output, i am guessing its because the cost of the inlined functions is spread to the

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread Spencer Janssen
On Tue, 3 Jul 2007 09:23:02 -1000 (HST) Tim Newsham [EMAIL PROTECTED] wrote: How about STM? It would be nice if I didn't have to scan the paper each time I do something with STM. Isn't that the point of having an API reference? -Brent Tim Newsham http://www.thenewsh.com/~newsham/

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread Andrew Coppin
Tim Newsham wrote: Is there a particular module you're having trouble with? Or just griping in general? =) How about STM? It would be nice if I didn't have to scan the paper each time I do something with STM. Isn't that the point of having an API reference? Similar remarks hold for

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread Andrew Coppin
Brent Yorgey wrote: Is there a reason why the documentation for virtually every module in Control.Monad simply begins with a line that says Inspired by some paper (http://www.ogi.edu/csee/~mpj/ http://www.ogi.edu/csee/%7Empj/) It's probably because it was felt that the

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread Brent Yorgey
It's also nice to have some brief comments in the API docs to say what the heck a particular module is even *for*, and provide enough info on the stuff in that module that you can quickly dip into it when you can't remember the name of something... I certainly don't disagree with you! I was

Re: [Haskell-cafe] Getting debugging/logging info?

2007-07-03 Thread Hugh Perkins
Ok, I'll play with that. On 7/3/07, Jules Bean [EMAIL PROTECTED] wrote: Hugh Perkins wrote: In imperative languages we can do this type of thing: SystemLogging.LogInfo(About to do something...); DoSomething(); SystemLogging.LogInfo(Did Something); SystemLogging.LogInfo(x is + x ); This

Re: [Haskell-cafe] sha1 implementation thats only 12 times slower then C

2007-07-03 Thread Alistair Bayley
On 03/07/07, Anatoly Yakovenko [EMAIL PROTECTED] wrote: inlining some of the functions definitely gave me a boost, so i am about 8.5 times slower then openssl sha1sum. I dont really understand the core output, but after inlining i got a completely different profile output, i am guessing its

Re: [Haskell-cafe] sha1 implementation thats only 12 times slower then C

2007-07-03 Thread Anatoly Yakovenko
Are you using -auto, or -auto-all? Because it makes a difference to the generated core, and the extent to which inlining takes place. I've noticed that -auto permits more inlining than -auto-all, so try -auto -auto doesn't generate any meaningfull profiling info for me if you can. Also,

Re: [Haskell-cafe] sha1 implementation thats only 12 times slower then C

2007-07-03 Thread Donald Bruce Stewart
aeyakovenko: inlining some of the functions definitely gave me a boost, so i am about 8.5 times slower then openssl sha1sum. I dont really understand the core output, but after inlining i got a completely different profile output, i am guessing its because the cost of the inlined functions

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread brad clawsie
It's also nice to have some brief comments in the API docs to say what the heck a particular module is even *for*, and provide enough info on the stuff in that module that you can quickly dip into it when you can't remember the name of something... agreed. for me, the perldocs for most

Re: [Haskell-cafe] Haskell's currying versus Business Objects GemCutter's burning

2007-07-03 Thread L.Guo
In this case, I usually use _flip_ function. flip :: (a - b - c) - b - a - c flip f x y = f y x -- L.Guo 2007-07-04 - From: peterv At: 2007-07-03 17:40:35 Subject: [Haskell-cafe] Haskell's

[Haskell-cafe] The Garbage Collector Ate My Homework

2007-07-03 Thread Thomas Conway
Well, not quite, but look at the following: 118,342,689,824 bytes allocated in the heap 144,831,738,780 bytes copied during GC (scavenged) 335,086,064 bytes copied during GC (not scavenged) 255,257,516 bytes maximum residency (42 sample(s)) 222884 collections in generation 0 (3891.90s)

Re: [Haskell-cafe] The Garbage Collector Ate My Homework

2007-07-03 Thread Tim Chevalier
On 7/3/07, Thomas Conway [EMAIL PROTECTED] wrote: Well, not quite, but look at the following: 118,342,689,824 bytes allocated in the heap 144,831,738,780 bytes copied during GC (scavenged) 335,086,064 bytes copied during GC (not scavenged) 255,257,516 bytes maximum residency (42 sample(s))