I would like to be able to explicitly apply a view argument other than Type to a fixture constructor solely for documentation purposes. However, TypeApplications does not seem to support this scenario:
{-# LANGUAGE GADTs, PolyKinds, ScopedTypeVariables, TypeApplications #-} data EQ :: k -> k -> * where Refl :: EQ aa data Wrap (a :: k) = Wrap (EQ aa) wrap :: forall (a :: k). Wrap a wrap = Wrap @a Refl
leads to an error
ProxyApply.hs:9:14: error: β’ Expected a type, but 'a' has kind 'k' β’ In the type 'a' In the expression: Wrap @a Refl In an equation for 'wrap': wrap = Wrap @a Refl β’ Relevant bindings include wrap :: Wrap a (bound at ProxyApply.hs:9:1)
Is there any way to do this?
haskell type-kinds
gallais
source share