On 12/31/11 8:18 AM, Yves Parès wrote:
Thanks for the explanation on free monads, it's interesting.
But still, I maintain my previous view. I could clarify that by saying that
(e.g. for Maybe) we could separate it in two types, Maybe itself and its
monad:
-- The plain Maybe type
data Maybe a =
Hello Café,
One thought occur to me recently when explaining the concept of Monad to
non-haskellers: internally, all standard Monads are newtypes wrapping
functions:
StateT is, WriterT is, ContT is. Even IO and ST are, both conceptually and
in their implementation by GHC.
ParsecT (not part of
Yves Parès :
all standard Monads are newtypes wrapping functions
What about Maybe and [] ?
Jerzy Karczmarczuk
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On 31 December 2011 12:26, Jerzy Karczmarczuk
jerzy.karczmarc...@unicaen.fr wrote:
Yves Parès :
all standard Monads are newtypes wrapping functions
What about Maybe and [] ?
And Identity ...
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Maybe and [] have still the same meaning: they can be seen as functions:
- they represent the result(s) that might or might not have a computation
- *they have to be called/ran/executed* (wichever term you prefer) through
Data.Maybe.maybe or Data.List.foldX, so that we can extract some value out
* Yves Parès limestrael+hask...@gmail.com [2011-12-31 13:09:37+0100]
One thought occur to me recently when explaining the concept of Monad to
non-haskellers: internally, all standard Monads are newtypes wrapping
functions:
StateT is, WriterT is, ContT is. Even IO and ST are, both conceptually
Thanks for the explanation on free monads, it's interesting.
But still, I maintain my previous view. I could clarify that by saying that
(e.g. for Maybe) we could separate it in two types, Maybe itself and its
monad:
-- The plain Maybe type
data Maybe a = Just a | Nothing
-- The MaybeMonad
On Dec 31, 2011 8:19 AM, Yves Parès limestrael+hask...@gmail.com wrote:
-- The plain Maybe type
data Maybe a = Just a | Nothing
-- The MaybeMonad
newtype MaybeMonad a = MM ( () - Maybe a )
That's what using Maybe as a monad semantically means, doesn't it?
I'd have to say no. That Maybe
On 31/12/2011 13:18, Yves Parès wrote:
But still, I maintain my previous view. I could clarify that by saying
that (e.g. for Maybe) we could separate it in two types, Maybe itself
and its monad:
-- The plain Maybe type
data Maybe a = Just a | Nothing
-- The MaybeMonad
newtype MaybeMonad a =
Yves Parès limestrael+hask...@gmail.com wrote:
But still, I maintain my previous view. I could clarify that by saying
that (e.g. for Maybe) we could separate it in two types, Maybe itself
and its monad:
-- The plain Maybe type
data Maybe a = Just a | Nothing
-- The MaybeMonad
newtype
In that sense every value in maths is a function. In other words: Your
extension of everything (!) to functions is redundant.
And function is not unique in this way. All types can be embedded into
pairs also, e.g., newtype MyInt = MyInt ((),Int), or newtype MyInt = MyInt
(((),Int),()), etc.
11 matches
Mail list logo