[Haskell-cafe] Aren't type system extensions fun? [Further analysis]

Kim-Ee Yeoh a.biurvOir4 at asuhan.com
Thu May 29 05:51:47 EDT 2008



Roberto Zunino-2 wrote:
> 
> Alas, for code like yours:
>    foo = \f -> (f 'J', f True)
> 
> there are infinite valid types too:
>    (forall a. a -> Int) -> (Int, Int)
>    (forall a. a -> Char)-> (Char, Char)
>    (forall a. a -> (a,a)) -> ((Char,Char),(Bool,Bool))
>    ...
> 
> and it is much less clear if a "best", most general type exists at all.
> 

How about
  foo :: (exists. m :: * -> *. forall a. a -> m a) -> (m Char, m Bool)

Not quite Haskell, but seems to cover all of the examples you gave.


-- Kim-Ee

-- 
View this message in context: http://www.nabble.com/Aren%27t-type-system-extensions-fun--tp17479349p17531238.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list