extensible-sp-0.1.0.0: light-weight, extensible sums and products over types and kinds

Safe HaskellNone
LanguageHaskell2010

Data.Extensible.Example

Description

Provides a simple example of how the extensible-sp is | employed. Two functions foo and bar both define an | independent sum constraint. foobar aggregates them.

Synopsis

Documentation

foo :: a :>|: String => a -> a Source #

reverse a string (if it is present)

bar :: a :>|: Int => a -> a Source #

add one to the integer

foobar :: (String :|: Int) -> String :|: Int Source #

Fix a concrete type for the extensible sum | and utilize the two polymorphic functions | foo and bar.

foobar' :: (((Char :|: String) :|: Int) :|: ()) -> ((Char :|: String) :|: Int) :|: () Source #

The concrete type need not be the minimal sum

runExample :: IO () Source #

run the example