[Haskell-cafe] Should "do 1" compile
Claus Reinke
claus.reinke at talk21.com
Wed May 23 19:29:04 EDT 2007
if you want to go down that route:
Prelude> let monadic m = m `asTypeOf` return undefined
Prelude> :t monadic undefined
monadic undefined :: (Monad m) => m a
Prelude> :t monadic $ undefined >> return ()
monadic $ undefined >> return () :: (Monad m) => m ()
Prelude> :t monadic $ undefined >> [ () ]
monadic $ undefined >> [ () ] :: [()]
Prelude> :t monadic $ undefined >> [ undefined ]
monadic $ undefined >> [ undefined ] :: [a]
btw, ghc says:
Prelude> :t do undefined
do undefined :: t t1
while hugs says:
Hugs> :t do undefined
do {...} :: Monad a => a b
claus
More information about the Haskell-Cafe
mailing list