Skip to content

int-index/union

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Union

Build Status Hackage

Extensible type-safe unions.

ghci> let a = openUnion # (5 :: Int) :: OpenUnion '[Bool, Int]

ghci> a ^? openUnion :: Maybe Int
Just 5

ghci> a ^? openUnion :: Maybe Bool
Nothing

ghci> a ^? openUnion :: Maybe Char
<interactive>:8:6:
    No instance for (UElem Char '[] (RIndex Char '[]))
      arising from a use of ‘openUnion’
    In the second argument of ‘(^?)’, namely ‘openUnion’
    In the expression: a ^? openUnion :: Maybe Char
    In an equation for ‘it’: it = a ^? openUnion :: Maybe Char

About

Extensible type-safe unions for Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages