On Tue, 5 Feb 2008, Felipe Lessa wrote:
On Feb 5, 2008 6:06 PM, Dan Weston [EMAIL PROTECTED] wrote:
Can you do this with a GHC rule? Something like:
{-# RULES
join_dot_fmap_return/id forall x . join (fmap return x) = x
#-}
Dan
I guess this would make use of the rule
On Feb 6, 2008 11:50 AM, Henning Thielemann
[EMAIL PROTECTED] wrote:
That is, if the rule would be stated as above, then
programmers _have_ to ensure that the law is satisfied, and the optimizer
will penalize violations of the rules with non-working code.
Be careful. For much less (blowing up
On Mon, 4 Feb 2008, Miguel Mitrofanov wrote:
Problem is that from the idea Functor is a superclass of Monad, with
the
property that fmap == liftM.
[cut]
The second relation can even not be expressed in Haskell 98.
Erm...
class Functor f where
fmap :: (a - b) - f a - f b
On Feb 5, 2008, at 8:31 , Henning Thielemann wrote:
How do you convince the compiler that
'join (fmap return x) == x' ?
How do you convince it that the current formulation of Monad obeys
the monad laws? (rhetorical)
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL
On Tue, 5 Feb 2008, Brandon S. Allbery KF8NH wrote:
On Feb 5, 2008, at 8:31 , Henning Thielemann wrote:
How do you convince the compiler that
'join (fmap return x) == x' ?
How do you convince it that the current formulation of Monad obeys
the monad laws? (rhetorical)
My point was
Can you do this with a GHC rule? Something like:
{-# RULES
join_dot_fmap_return/id forall x . join (fmap return x) = x
#-}
Dan
Henning Thielemann wrote:
On Tue, 5 Feb 2008, Brandon S. Allbery KF8NH wrote:
On Feb 5, 2008, at 8:31 , Henning Thielemann wrote:
How do you convince the
On Feb 5, 2008 6:06 PM, Dan Weston [EMAIL PROTECTED] wrote:
Can you do this with a GHC rule? Something like:
{-# RULES
join_dot_fmap_return/id forall x . join (fmap return x) = x
#-}
Dan
I guess this would make use of the rule (otherwise the transformation
would change the code's
Problem is that from the idea Functor is a superclass of Monad, with
the
property that fmap == liftM.
[cut]
The second relation can even not be expressed in Haskell 98.
Erm...
class Functor f where
fmap :: (a - b) - f a - f b
class Functor m = Monad m where
return :: a - m a
On Mon, 2008-02-04 at 12:22 -0200, Felipe Lessa wrote:
Hi there,
Reading http://www.haskell.org/haskellwiki/Things_to_avoid I found an
interesting saying:
By the way, in the case of IO monad the Functor class method fmap and
the Monad based function liftM are the same.
I always tought
On Mon, 4 Feb 2008, Felipe Lessa wrote:
Hi there,
Reading http://www.haskell.org/haskellwiki/Things_to_avoid I found an
interesting saying:
By the way, in the case of IO monad the Functor class method fmap and
the Monad based function liftM are the same.
I always tought that
prop ::
Hi there,
Reading http://www.haskell.org/haskellwiki/Things_to_avoid I found an
interesting saying:
By the way, in the case of IO monad the Functor class method fmap and
the Monad based function liftM are the same.
I always tought that
prop :: (Functor m, Monad m, Eq (m b)) = (a - b) - m a -
On 4 Feb 2008, at 6:22 AM, Felipe Lessa wrote:
Hi there,
Reading http://www.haskell.org/haskellwiki/Things_to_avoid I found an
interesting saying:
By the way, in the case of IO monad the Functor class method fmap and
the Monad based function liftM are the same.
I always tought that
prop ::
12 matches
Mail list logo