Copyright | (c) Conal Elliott 2007 |
---|---|
License | BSD3 |
Maintainer | conal@conal.net |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
A monoid Partial
of partial values. See the [Teaser] and [Solution] blog
posts.
- Teaser
- http://conal.net/blog/posts/a-type-for-partial-values
- Solution
- http://conal.net/blog/posts/implementing-a-type-for-partial-values
Also defines a FunAble
instance, so that FunA Partial
is an arrow.
Partial values
valp :: c -> Partial c Source #
Treat a full value as a partial one. Fully overrides any
"previous" (earlier argument to mappend
) partial value.
pval :: Partial c -> c Source #
Force a partial value into a full one, filling in bottom for any missing parts.
pUnElt :: Functor f => PartialX a (f a) Source #
Inverse to "element" access, on all elements. A way to inject some
info about every element. For f
, consider '[]', (->) a
,
Event
, etc.
pUnSrc :: PartialX a ((a -> b) -> o) Source #
Inject a partial argument-source into a partial function-sink.
Support for arrow partial value arrow
Orphan instances
FunAble Partial Source # | |
arrFun :: (a -> b) -> Partial a -> Partial b Source # firstFun :: (Partial a -> Partial a') -> Partial (a, b) -> Partial (a', b) Source # secondFun :: (Partial b -> Partial b') -> Partial (a, b) -> Partial (a, b') Source # (***%) :: (Partial a -> Partial b) -> (Partial a' -> Partial b') -> Partial (a, a') -> Partial (b, b') Source # (&&&%) :: (Partial a -> Partial b) -> (Partial a -> Partial b') -> Partial a -> Partial (b, b') Source # |