[Haskell-cafe] Question of a manual computation on Reader Monad.

Kim-Ee Yeoh a.biurvOir4 at asuhan.com
Sat Aug 25 11:10:47 EDT 2007



一首诗 wrote:
> 
> runReader (do { b <- Reader $ show; return b } )  -- This is the initial
> expression, it should equals "show"
> 
> runReader (Reader $ show >>= \b -> return b)   -- remove do notion
> 

I'm not sure that's the right un-do-ization. It so happens that the 
exponent monad ((->) r) and the Reader monads are semantically 
identically. Is this a homework question?


一首诗 wrote:
> 
> runReader (Reader $ \e -> return( show e ) e)  -- apply the definition of
> ">>="
> 
> runReader (Reader $ \e -> (Reader $ \e1 -> show(e)) e)  -- apply the
> definition of "return"
> 
> But the last expression is incorrect, and I don't know how to go on.
> 

-- 
View this message in context: http://www.nabble.com/Question-of-a-manual-computation-on-Reader-Monad.-tf4328025.html#a12326875
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list