2008/10/1 Cetin Sert <[EMAIL PROTECTED]>:
> warn :: String → IO Int
> warn = return 1 << putStrLn-- causes an error
> -- = \msg → return 1 << putStrLn msg -- works just fine
> -- = \msg → putStrLn msg >> return 1 -- works just fine
>
> (<<) :: Monad m ⇒ m b → m a → m b
> b << a = a
Am Mittwoch, 1. Oktober 2008 12:18 schrieb Cetin Sert:
> warn :: String → IO Int
> warn = return 1 << putStrLn-- causes an error
try
warn = (return 1 <<) . putStrLn
> -- = \msg → return 1 << putStrLn msg -- works just fine
> -- = \msg → putStrLn msg >> return 1 -- works just fine
Hi Cetin,
what you seem to want is
> warn :: String -> IO Int
> warn = (return 1 <<) . putStrLn
Cetin Sert schrieb:
> warn :: String → IO Int
> warn = return 1 << putStrLn-- causes an error
> -- = \msg → return 1 << putStrLn msg -- works just fine
> -- = \msg → putStrLn msg >> re
2008/10/1 Cetin Sert <[EMAIL PROTECTED]>:
> warn :: String → IO Int
> warn = return 1 << putStrLn-- causes an error
> -- = \msg → return 1 << putStrLn msg -- works just fine
> -- = \msg → putStrLn msg >> return 1 -- works just fine
>
> (<<) :: Monad m ⇒ m b → m a → m b
> b << a = a
warn :: String → IO Int
warn = return 1 << putStrLn-- causes an error
-- = \msg → return 1 << putStrLn msg -- works just fine
-- = \msg → putStrLn msg >> return 1 -- works just fine
(<<) :: Monad m ⇒ m b → m a → m b
b << a = a >>= \_ → b
Why do I get this compile-time error?? How