Hello,

I just noticed that the GHC/Hugs "standard" libraries have acquired a

list monad transformer, which is broken, because it does not satisfy

the associativity law when applied to non-commutative monads. I am

not referring to some corner-case strictness problem, but rather a

fairly well known result. The associativity law is important, because

without it the 'do' notation can be very confusing. Bellow is an

example, for people not familiar with the porblem.

-Iavor

import Control.Monad.List

say :: String -> ListT IO ()

say x = lift (putStr x)

one_two, ex1,ex2 :: ListT IO ()

one_two = say "1 " `mplus` say "2 "

ex1 = do one_two

say "3 "

say "4 "

ex2 = do do one_two

say "3 "

say "4 "

main = runListT ex1 >> putStrLn " or " >> runListT ex2

_______________________________________________

Libraries mailing list

[hidden email]
http://www.haskell.org/mailman/listinfo/libraries