Re: [Haskell-cafe] one-way monads

On Tuesday 20 May 2008, ajb@spamcop.net wrote:
Actually, it's true less than 50% of the time. In particular, it's not true of any monad transformer.
Sure it is. Any particular transformer t typically comes with some particular way of writing a function of type t m a -> m a (you may have to throw away some t-related stuff, of course). Since a specific transformed monad is built from a specific monad, and a specific transformer, and specific transformers are likely to have a function of type t m a -> m a, and specific monads are likely to have functions of type m a -> a, you can compose them to get a function of type t m a -> a for the specific monad t m. And so on for transformed-transformed monads. :) That only fails if either of the specific pieces fails to have the right function, which happens well under 50% of the time, I think (IO and STM are the ones that immediately occur to me (barring a certain evil function), although you could make a case for ST by technicality; no failing transformers come to mind (except CCT if we're counting ST), but I haven't wracked my brain very hard). -- Dan

Dan Doel wrote:
On Tuesday 20 May 2008, ajb@spamcop.net wrote:
Actually, it's true less than 50% of the time. In particular, it's not true of any monad transformer.
Sure it is. Any particular transformer t typically comes with some particular way of writing a function of type t m a -> m a (you may have to throw away some t-related stuff, of course).
Since a specific transformed monad is built from a specific monad, and a specific transformer, and specific transformers are likely to have a function of type t m a -> m a, and specific monads are likely to have functions of type m a -> a, you can compose them to get a function of type t m a -> a for the specific monad t m. And so on for transformed-transformed monads. :)
That only fails if either of the specific pieces fails to have the right function, which happens well under 50% of the time, I think (IO and STM are the ones that immediately occur to me (barring a certain evil function), although you could make a case for ST by technicality; no failing transformers come to mind (except CCT if we're counting ST), but I haven't wracked my brain very hard).
-- Dan
The claim was "less than 50% of the time", not "less than 50% of the monads in the standard libraries". I wonder what fraction of monads in real code the IO monad alone accounts for? 50% does not seem implausible to me. Dan Weston

I certainly don't use 50% IO monads. I regard any use of the IO monad
except at the top level as a failure. :)
On Wed, May 21, 2008 at 7:14 PM, Dan Weston
Dan Doel wrote:
On Tuesday 20 May 2008, ajb@spamcop.net wrote:
Actually, it's true less than 50% of the time. In particular, it's not true of any monad transformer.
Sure it is. Any particular transformer t typically comes with some particular way of writing a function of type t m a -> m a (you may have to throw away some t-related stuff, of course).
Since a specific transformed monad is built from a specific monad, and a specific transformer, and specific transformers are likely to have a function of type t m a -> m a, and specific monads are likely to have functions of type m a -> a, you can compose them to get a function of type t m a -> a for the specific monad t m. And so on for transformed-transformed monads. :)
That only fails if either of the specific pieces fails to have the right function, which happens well under 50% of the time, I think (IO and STM are the ones that immediately occur to me (barring a certain evil function), although you could make a case for ST by technicality; no failing transformers come to mind (except CCT if we're counting ST), but I haven't wracked my brain very hard).
-- Dan
The claim was "less than 50% of the time", not "less than 50% of the monads in the standard libraries". I wonder what fraction of monads in real code the IO monad alone accounts for? 50% does not seem implausible to me.
Dan Weston
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

lennart:
I certainly don't use 50% IO monads. I regard any use of the IO monad except at the top level as a failure. :)
IO fail -- Don Background: http://failblog.org/

On Wed, May 21, 2008 at 4:08 PM, Lennart Augustsson
I certainly don't use 50% IO monads. I regard any use of the IO monad except at the top level as a failure. :)
Real Haskell Programmers Only Use Top Level IO! (But then again, real programmers wouldn't use Haskell: http://www.pbm.com/~lindahl/real.programmers.html) -- Dan

Hi
Real Haskell Programmers Only Use Top Level IO!
(But then again, real programmers wouldn't use Haskell: http://www.pbm.com/~lindahl/real.programmers.html)
It's amazing how many phone interviews I've done where the HR person at the other end tries to tick the "knows Pascal" box, despite me trying my hardest to pronounce Hhhhhhhhhaskell. Maybe Haskell == Pascal, under some fairly light equality.... Thanks Neil

On Wed, May 21, 2008 at 6:37 PM, Neil Mitchell
Hi
Real Haskell Programmers Only Use Top Level IO!
(But then again, real programmers wouldn't use Haskell: http://www.pbm.com/~lindahl/real.programmers.htmlhttp://www.pbm.com/%7Elindahl/real.programmers.html )
It's amazing how many phone interviews I've done where the HR person at the other end tries to tick the "knows Pascal" box, despite me trying my hardest to pronounce Hhhhhhhhhaskell. Maybe Haskell == Pascal, under some fairly light equality....
Thanks
Neil _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
I've had the same experience! I don't swallow my 'h's in the slightest, so I'm presuming that it's just overly eager pattern matching.
participants (7)
-
Creighton Hogg
-
Dan Doel
-
Dan Piponi
-
Dan Weston
-
Don Stewart
-
Lennart Augustsson
-
Neil Mitchell