Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jberryman/proxy-kindness
A Haskell library for kind-polymorphic manipulation and inspection of Proxy values
https://github.com/jberryman/proxy-kindness
Last synced: about 1 month ago
JSON representation
A Haskell library for kind-polymorphic manipulation and inspection of Proxy values
- Host: GitHub
- URL: https://github.com/jberryman/proxy-kindness
- Owner: jberryman
- License: bsd-3-clause
- Created: 2013-11-15T02:08:54.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-11-15T02:43:10.000Z (about 11 years ago)
- Last Synced: 2024-03-14T19:30:51.836Z (10 months ago)
- Language: Haskell
- Size: 105 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
A small library for kind-polymorphic manipulation and inspection of
[`Proxy`](http://hackage.haskell.org/package/tagged-0.7/docs/Data-Proxy.html)
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 aDo 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 aForce 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