Skip to content

A Haskell library for kind-polymorphic manipulation and inspection of Proxy values

License

Notifications You must be signed in to change notification settings

jberryman/proxy-kindness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A small library for kind-polymorphic manipulation and inspection of Proxy values. Here are some usage examples:

Force @Left 1@ to be of type @Either Float a@ using a partially-applied 'Proxy'.

>>> let t = (Left 1) `asApplied` (Proxy :: Proxy (Either Float))
>>> :t t
t :: Either Float a

Do the same, but illustrating type application with @ap@

>>> let t0 = (Left 1) `asApplied` ((Proxy :: Proxy Either) `ap` (Proxy :: Proxy Float))
>>> :t t0
t0 :: Either Float a

Force polymorphic @undefined@ to some polymorphic @Either@ type, the base type of @t@ defined above.

>>> let u = undefined `asApplied` (unappliedOf t)
>>> :t u
u :: Either a a1

About

A Haskell library for kind-polymorphic manipulation and inspection of Proxy values

Resources

License

Stars

Watchers

Forks

Packages

No packages published