A library for kind-polymorphic manipulation and inspection of Proxy values https://github.com/jberryman/proxy-kindness
|Latest on Hackage:||0.1|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
It can be useful (especially with
PolyKinds) to get the
"bare" type (e.g.
Either) of some parameterized type
Either Char Int). This library provides closed
classes that can strip and reapply type arguments, as well
as useful utility functions. Here are some examples:
Left 1 to be of type
Either Float a using a
let t = (Left 1) `asApplied` (Proxy :: Proxy (Either Float))
t :: Either Float a
Do the same, but illustrating type application with
let t0 = (Left 1) `asApplied` ((Proxy :: Proxy Either) `ap` (Proxy :: Proxy Float))
t0 :: Either Float a
undefined to some polymorphic
type, the base type of
t defined above.
let u = undefined `asApplied` (unappliedOf t)
u :: Either a a1