monadfix / named

Named parameters (keyword arguments) for Haskell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rank-N arguments not supported

3noch opened this issue · 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

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

Perhaps this should be in the docs?

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