Skip to content

Type equality check returning a Boolean kind. Useful for type-level programming.

License

Notifications You must be signed in to change notification settings

justinwoo/purescript-type-isequal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

purescript-type-isequal

Build Status

Type equality check returning a Boolean kind. Useful for type-level programming.

Example

From tests:

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)

About

Type equality check returning a Boolean kind. Useful for type-level programming.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published