Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justinwoo/purescript-type-isequal
Type equality check returning a Boolean kind. Useful for type-level programming.
https://github.com/justinwoo/purescript-type-isequal
purescript type-level
Last synced: about 2 months ago
JSON representation
Type equality check returning a Boolean kind. Useful for type-level programming.
- Host: GitHub
- URL: https://github.com/justinwoo/purescript-type-isequal
- Owner: justinwoo
- License: mit
- Created: 2018-07-03T17:46:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-15T17:09:59.000Z (almost 5 years ago)
- Last Synced: 2024-10-11T23:44:09.193Z (2 months ago)
- Topics: purescript, type-level
- Language: PureScript
- Homepage:
- Size: 2.93 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# purescript-type-isequal
[![Build Status](https://travis-ci.org/justinwoo/purescript-type-isequal.svg?branch=master)](https://travis-ci.org/justinwoo/purescript-type-isequal)
Type equality check returning a `Boolean` kind. Useful for type-level programming.
## Example
From tests:
```purs
isEqual
:: forall a b result
. IsEqual a b result
=> Proxy a
-> Proxy b
-> BProxy result
isEqual _ _ = BProxy-- this is true as Int is Int
testA :: BProxy True
testA = isEqual (Proxy :: Proxy Int) (Proxy :: Proxy Int)-- this is false as Int is not String
testB :: BProxy False
testB = isEqual (Proxy :: Proxy Int) (Proxy :: Proxy String)
```