named icon indicating copy to clipboard operation
named copied to clipboard

Rank-N arguments not supported

Open 3noch opened this issue 6 years ago • 3 comments

{-# LANGUAGE LiberalTypeSynonyms #-}

test :: "arg" :! (forall a. f a -> g a) -> f b -> g b
test x = x

complains with

    • Illegal polymorphic type: forall a. f a -> g a
      GHC doesn't yet support impredicative polymorphism
    • In the type signature:
        test :: "arg" :! (forall a. f a -> g a) -> f b -> g b
   |
   | test :: "arg" :! (forall a. f a -> g a) -> f b -> g b

3noch avatar May 23 '19 22:05 3noch

Alas, I don't think named (or any other library) can work around this GHC restriction.

int-index avatar May 23 '19 22:05 int-index

Perhaps this should be in the docs?

3noch avatar May 23 '19 23:05 3noch

The workaround, I suppose, being that you must define a type for your argument.

3noch avatar May 24 '19 00:05 3noch