[Haskell-cafe] RankNTypes question

Nikolay Amiantov ab at fmap.me
Thu Feb 26 18:36:42 UTC 2015


Hm, now that I look at it, I've given the wrong example which badly 
describes what I want -- sorry. Let me give you a more specific one:

{-# LANGUAGE RankNTypes #-}

test :: (forall a. (a -> a)) -> (Int -> Int)
test = id-- something else should be here

i.e., I want to "specialize" a polymorphic value -- in this case, a 
polymorphic function to the function on `Int`s.

On 02/26/2015 09:24 PM, Marcin Mrotek wrote:
> Hello,
>
> id has type a -> a, a function from some type to exactly the same
> type. Your function would be from any type to any other (the same type
> as given being a special case). It seem to me that
>
> example _ = undefined
>
> is the only legal definition. What do you exactly want the function to do?
>
> Kind regards,
> Marcin Mrotek

-- 
Nikolay.



More information about the Haskell-Cafe mailing list