Maintainer | conal@conal.net |
---|---|
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Demand algebra
Synopsis
- data Demand :: * -> * where
- demand :: Demand a -> Unop a
- nothing :: Unop a
- split :: Demand a -> (Unop a, Unop a)
- _split :: Demand a -> (Unop a, Unop a)
- lift2Split :: (Unop a -> Unop b -> c) -> Demand a -> Demand b -> (c, c)
- complementD :: Unop (Demand a)
- (*:) :: Demand a -> Demand b -> Demand (a :* b)
- (+:) :: Demand a -> Demand b -> Demand (a :+ b)
- (>:) :: Demand a -> Demand b -> Demand (a -> b)
- combineD :: Unop (Demand a -> Demand b -> Demand (a `op` b))
- pairD :: (Demand a :* Demand b) -> Demand (a :* b)
- unpairD :: Demand (a :* b) -> Demand a :* Demand b
- inUnpairD :: ((Demand a' :* Demand b') -> Demand a :* Demand b) -> Demand (a' :* b') -> Demand (a :* b)
- plusD :: (Demand a, Demand b) -> Demand (a :+ b)
- unplusD :: Demand (a :+ b) -> (Demand a, Demand b)
- inUnplusD :: ((Demand a' :* Demand b') -> Demand a :* Demand b) -> Demand (a' :+ b') -> Demand (a :+ b)
- funD :: (Demand a, Demand b) -> Demand (a -> b)
- unfunD :: Demand (a -> b) -> (Demand a, Demand b)
- inUnfunD :: ((Demand a, Demand b) -> (Demand a', Demand b')) -> Demand (a -> b) -> Demand (a' -> b')
- mergeD :: Demand (a :* a) -> Demand a
- lubD :: Demand a -> Demand a -> Demand a
- glbD :: Demand a -> Demand a -> Demand a
- newtype a :-? b = RX (Demand b -> Demand a)
- hyperStrict :: a :-? b
Documentation
data Demand :: * -> * where Source #
Demand pattern
split :: Demand a -> (Unop a, Unop a) Source #
Alternative Semantic function. Splits into needed info and complement.
complementD :: Unop (Demand a) Source #
Complement of Demand
combineD :: Unop (Demand a -> Demand b -> Demand (a `op` b)) Source #
Building block for smart constructor, assuming that NoneD
and op
NoneD ==
NoneDAllD
.op
AllD == AllD
inUnpairD :: ((Demand a' :* Demand b') -> Demand a :* Demand b) -> Demand (a' :* b') -> Demand (a :* b) Source #
inUnplusD :: ((Demand a' :* Demand b') -> Demand a :* Demand b) -> Demand (a' :+ b') -> Demand (a :+ b) Source #
inUnfunD :: ((Demand a, Demand b) -> (Demand a', Demand b')) -> Demand (a -> b) -> Demand (a' -> b') Source #
lubD :: Demand a -> Demand a -> Demand a Source #
Least upper bound on demands. Specification:
demand (ra
.lubD
rb) == demand ra lub
demand rb
glbD :: Demand a -> Demand a -> Demand a Source #
Greatest lower bound on demands. Specification:
demand (ra
.glbD
rb) == demand ra glb
demand rb
newtype a :-? b infixr 1 Source #
Demand flow category, running counter to value flow
Instances
hyperStrict :: a :-? b Source #