I often use local loops in monadic code, e.g.
main = do
...
let loop = do
...
if cond then loop else return ()
loop
It seems that I can encode this idiom slightly more concise with the 'fix'
operator (from Control.Monad.Fix), i.e.
main = do
Date: Tue, 14 Dec 2004 10:24:15 -0500
From: Andrew Pimlott [EMAIL PROTECTED]
Subject: Re: [Haskell-cafe] The difference between ($) and application
On Tue, Dec 14, 2004 at 11:23:24AM +0100, Henning Thielemann wrote:
On Tue, 14 Dec 2004, Andrew Pimlott wrote:
(Of course, it's still
Andres Loeh [EMAIL PROTECTED] writes:
The function ($) is the identity function, restricted to functions.
Almost. With the standard definition of
f $ x = f x
it happens that
($) undefined `seq` () = ()
id undefined `seq` () = undefined
--
__( Marcin Kowalczyk
\__/
On the other hand, it's difficult or impossible to make a list of a
bunch of different types of things that have nothing in common save
being members of the class.
I've recently been playing with making, for each class C, a
interface datatype IC (appropriately universally and
Derek Elkins wrote:
Andrew Pimlott wrote:
I think this post should go under the heading ($) considered
harmful. I've been bitten by this, and I never use ($) anymore in
place of parentheses because it's too tempting to think of it as
syntax.
I find this position ridiculous. [...] If you ever make
At Fri, 03 Dec 2004 10:40:45 -0800,
Jeremy Shaw wrote:
At Fri, 03 Dec 2004 10:56:24 -0500,
Jason Bailey wrote:
Would anyone know of packages out there for Haskell that support mp3's
or ogg files?
I have some haskell bindings to libmad somewhere ... I don't remember
how complete
On Tue, Dec 14, 2004 at 01:49:57PM -0500, Derek Elkins wrote:
On Mon, Dec 13, 2004 at 07:49:00PM -0800, oleg at pobox.com wrote:
The operator ($) is often considered an application operator of a
lower precedence. Modulo precedence, there seem to be no difference
between ($) and `the
[EMAIL PROTECTED] wrote:
[...]
However, if we try
t2' = W $ id
we get an error:
/tmp/t1.hs:13:
Inferred type is less polymorphic than expected
Quantified type variable `a' escapes
Expected type: (a - a) - b
Inferred type: (forall a1. a1 - a1) - W
In the first argument
I can understand how calling this kind of function effectual makes
sense in the magic IO monad, or perhaps even in the ST and State
monads, because the term seems to imply side-effects. However, it is a
misnomer for eg, the Error, List and Cont monads.
It depends a bit on how wide you
What is a function of the followning type called:
f :: (Monad m) = (a - m b)
Is there a special term describing such a function (a function into a
monad)?
For f in
a = f
is en example.
Need it for an article/report.
Regards/Henning
Well, formally, it's called a Kleisli arrow
Derek Elkins wrote:
Andrew Pimlott wrote:
I think this post should go under the heading ($) considered
harmful. I've been bitten by this, and I never use ($) anymore in
place of parentheses because it's too tempting to think of it as
syntax.
I find this position ridiculous. [...]
Per Larsson [EMAIL PROTECTED] wrote:
I often use local loops in monadic code, e.g.
main = do
...
let loop = do
...
if cond then loop else return ()
loop
It seems that I can encode this idiom slightly more concise with the 'fix'
Derek Elkins [EMAIL PROTECTED] wrote:
Personally, I would mind ($) being magical. One of the nice things
about Haskell is there is practically no magic. The last thing I want
is Haskerl (http://www.dcs.gla.ac.uk/~partain/haskerl.html). runST
simply had a rank-2 type that is not
13 matches
Mail list logo