No instance for (Monad ((->) Integer))

I'm getting this error in ghci, and I think it should typecheck just fine. Prelude> let fs = [(+2), (*4)] Prelude> :t fs fs :: [Integer -> Integer] Prelude> :t sequence fs <interactive>:1:0: No instance for (Monad ((->) Integer)) arising from use of `sequence' at <interactive>:1:0-10 Possible fix: add an instance declaration for (Monad ((->) Integer)) I'm using ghc-6.6-3 on Ubuntu edgy, installed as described on Pupeno's web site (http://pupeno.com/2006/12/17/unstable-packages-on-ubuntu/) Could something be installed incorrectly, or am I just misreading the type info? Thanks, Chad

On 2/5/07, Neil Mitchell
Hi Chad,
Prelude> let fs = [(+2), (*4)] Prelude> :t fs fs :: [Integer -> Integer] Prelude> :t sequence fs
I think you need to import Control.Monad.Instances to get the appropriate instance in scope.
Hmm, that's weird. The instance Monad ((->) r) is mentioned in Control.Monad, so I thought importing it might be enough.
participants (2)
-
Chad Scherrer
-
Neil Mitchell