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...
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:
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
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
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
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
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 -
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
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
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
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
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:
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
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:
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
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
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
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
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
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
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? ;)
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
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
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
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
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
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/
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
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
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
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
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
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,
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
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
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
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)
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))
38 matches
Mail list logo