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

Safe HaskellNone
LanguageHaskell2010

Data.Extensible.Sum

Documentation

data a :|: b Source #

Constructors

DataL a 
DataR b 

Instances

(Eq b, Eq a) => Eq ((:|:) a b) Source # 

Methods

(==) :: (a :|: b) -> (a :|: b) -> Bool #

(/=) :: (a :|: b) -> (a :|: b) -> Bool #

(Show b, Show a) => Show ((:|:) a b) Source # 

Methods

showsPrec :: Int -> (a :|: b) -> ShowS #

show :: (a :|: b) -> String #

showList :: [a :|: b] -> ShowS #

SumClass c a => SumClass ((:|:) c b) a Source # 

Methods

peek :: (c :|: b) -> Maybe a Source #

lft :: a -> c :|: b Source #

SumClass ((:|:) a b) b Source # 

Methods

peek :: (a :|: b) -> Maybe b Source #

lft :: b -> a :|: b Source #

class SumClass c s where Source #

Minimal complete definition

peek, lft

Methods

peek :: c -> Maybe s Source #

lft :: s -> c Source #

Instances

SumClass a a Source # 

Methods

peek :: a -> Maybe a Source #

lft :: a -> a Source #

SumClass (Maybe a) a Source # 

Methods

peek :: Maybe a -> Maybe a Source #

lft :: a -> Maybe a Source #

SumClass (Either a b) a Source # 

Methods

peek :: Either a b -> Maybe a Source #

lft :: a -> Either a b Source #

SumClass c a => SumClass ((:|:) c b) a Source # 

Methods

peek :: (c :|: b) -> Maybe a Source #

lft :: a -> c :|: b Source #

SumClass ((:|:) a b) b Source # 

Methods

peek :: (a :|: b) -> Maybe b Source #

lft :: b -> a :|: b Source #

type (:>|:) w a = SumClass w a Source #

sumPrism :: w :>|: a => Prism' w a Source #