[Haskell-cafe] Typechecking Help

Dominic Steinitz dominic.steinitz at blueyonder.co.uk
Mon Jan 2 09:39:38 EST 2006


On Monday 02 Jan 2006 10:59 am, Bulat Ziganshin wrote:
> Hello Dominic,
>
> Monday, January 02, 2006, 11:59:53 AM, you wrote:
>
> *Codec.ASN1.BER>> :t choiceAux
> DS> choiceAux :: forall (m :: * -> *) e e1.
> DS>              (MonadState [Maybe Encoding] m,
> DS>               MonadState [Maybe Encoding] (StateT [Maybe Encoding] m),
> DS>               MonadError e (StateT [Maybe Encoding] m),
> DS>               MonadError e1 m) =>
> DS>              (TagPlicity, NamedType) -> Encoding -> m Defaulted
>
> DS> But if I try to give it a type annotation of
>
> DS> choiceAux :: (MonadState [Maybe Encoding] m,
> DS>               MonadState [Maybe Encoding] (StateT [Maybe Encoding] m),
> DS>               MonadError e (StateT [Maybe Encoding] m),
> DS>               MonadError e1 m) =>
> DS>              (TagPlicity, NamedType) -> Encoding -> m Defaulted
>
> you omited `forall` specifier, which, i think, makes the difference
Bulat,

I get the same error and furthermore I thought that any free type variables 
were implicitly quantified, e.g.,

foobar :: Eq a => a -> a -> Bool
foobar x y = if x == y then True else False

*Main> :t foobar
foobar :: forall a. (Eq a) => a -> a -> Bool

Dominic.



More information about the Haskell-Cafe mailing list