Type abstraction in GHC Haskell
问题 I'd love to get the following example to type-check: {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} module Foo where f :: Int -> (forall f. Functor f => Secret f) -> Int f x _ = x g :: (forall f. Functor f => Secret f) -> Int g = f 4 type family Secret (f :: * -> *) :: * where Secret f = Int I get it that it's probably not possible to infer and check g s type (even though in this specific case it's obvious