Data.Partial
 Portability portable Stability experimental Maintainer conal@conal.net
 Contents Partial values Support for arrow partial value arrow
Description

A monoid Partial of partial values. See the [Teaser] and [Solution] blog posts.

Teaser
: http://conal-elliott.blogspot.com/2007/07/type-for-partial-values.html [Solution]: http://conal-elliott.blogspot.com/2007/07/implementing-type-for-partial-values.html

Also defines a FunAble instance, so that FunA Partial is an arrow.

Synopsis
 type Partial = Endo type PartialX a b = Partial a -> Partial b valp :: c -> Partial c pval :: Partial c -> c pUnElt :: Functor f => PartialX a (f a) pUnArg :: PartialX u (u -> v) pUnRes :: PartialX v (u -> v) pUnSrc :: PartialX a ((a -> b) -> o)
Partial values
 type Partial = Endo Source
Partial value. Represented an endomorphism, which is a Monoid under id and '(.)'. Then mempty is the completely undefined value, and in u `@'mappend'@` v, v selectively replaces parts of u. The Endo instances for Pair, Unpair, Copair, Unfun, and Cofun are all very useful on partial values.
 type PartialX a b = Partial a -> Partial b Source
 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.
 pUnArg :: PartialX u (u -> v) Source
Provide in info about a function argument
 pUnRes :: PartialX v (u -> v) Source
Provide info about a function result
 pUnSrc :: PartialX a ((a -> b) -> o) Source
Inject a partial argument-source into a partial function-sink.
Support for arrow partial value arrow