
GHC can give you a warning when you fail to use the result of a monadic action in a do block. The same does not hold for arrow commands in arrow notation. (See demonstration below signature). What would it take to add a warning for this? I am writing arrow-heavy code at the moment and I think such a warning would be a nice feature. Tom % cat Test.hs {-# LANGUAGE Arrows #-} module Test where import Control.Arrow (returnA, arr) import Control.Monad.Identity (Identity(..)) foo :: Identity () foo = do Identity True return () bar :: () -> () bar = proc () -> do arr (const True) -< () returnA -< () % ghc -fforce-recomp -Wall Test.hs [1 of 1] Compiling Test ( Test.hs, Test.o ) Test.hs:10:5: Warning: A do-notation statement discarded a result of type Bool. Suppress this warning by saying "_ <- Data.Functor.Identity.Identity GHC.Types.True", or by using the flag -fno-warn-unused-do-bind
participants (1)
-
Tom Ellis