[Haskell-cafe] One-way and two-way monads.
khchoi at jaist.ac.jp
Tue Oct 12 13:45:03 EDT 2004
List and IO are both monads when appropriate operations are defined.
The IO monad, which is a one-way monad, does not have a function of
type IO a -> a, in general, except an unsafe function
"unsafePerformIO :: IO a -> a". A two-way monad, such as List, has such
a function "head :: [a] -> a".
My rough question is:
Is there any intersting theory on the relationship between one-way monads
and two-way monads? For example, a restriction on the IO monad would offer
a *safe* "unsafePerformIO", and so the IO monad would become a two-way
Does this question make sense at all?
Thanks in advance.
More information about the Haskell-Cafe