Module
Containers.Difference
- Package
- purescript-difference-containers
- Repository
- 8084/purescript-difference-containers
#Difference Source
newtype Difference cnt e
Difference cnt e
is a data structure analogous to difference lists,
where cnt
is a container type, e.g. List
from Data.List.Lazy
,
and e
is an element type.
Constructors
Difference (Endo Func (cnt e))
Instances
(Diff cnt) => Semigroup (Difference cnt e)
(Diff cnt) => Monoid (Difference cnt e)
(Diff cnt) => Foldable (Difference cnt)
(Diff cnt, Unfoldable1 cnt) => Unfoldable1 (Difference cnt)
(Diff cnt, Unfoldable cnt) => Unfoldable (Difference cnt)
(Diff cnt, Traversable cnt) => Traversable (Difference cnt)
(Diff cnt, Functor cnt) => Functor (Difference cnt)
(Diff cnt, Monad cnt) => Apply (Difference cnt)
(Diff cnt, Monad cnt) => Bind (Difference cnt)
(Diff cnt, Monad cnt) => Applicative (Difference cnt)
(Diff cnt, Monad cnt) => Monad (Difference cnt)
(Show a, Show (cnt a), Diff cnt) => Show (Difference cnt a)
(Monoid (cnt a), Diff cnt, Eq (cnt a)) => Eq (Difference cnt a)
(Monoid (cnt a), Diff cnt, Ord (cnt a)) => Ord (Difference cnt a)
#Diff Source
class (Foldable cnt) <= Diff cnt where
Diff
typeclass generalizes difference lists.
dempty
is an empty structure used for unfoldingDifference cnt e
.dappend
is an associative operation with time complexity that depends on the first argument's size more than on the size of the second.dsingleton
should wrap one element into the container.
Members
dempty :: forall a. cnt a
dappend :: forall a. cnt a -> cnt a -> cnt a
dsingleton :: forall a. a -> cnt a
Instances
#fromFoldable Source
fromFoldable :: forall f. Diff f => Foldable f => f ~> (Difference f)
#fromFoldable' Source
fromFoldable' :: forall d f. Diff d => Foldable f => f ~> (Difference d)
For any Foldable
container, construct any other Diff
container.
#toContainer Source
toContainer :: forall cnt. Diff cnt => (Difference cnt) ~> cnt
#fromContainer Source
fromContainer :: forall cnt. Diff cnt => cnt ~> (Difference cnt)
#singleton Source
singleton :: forall a cnt. Diff cnt => a -> Difference cnt a
#cons Source
cons :: forall a cnt. Diff cnt => a -> Difference cnt a -> Difference cnt a
O(1). Prepend a single element.
#snoc Source
snoc :: forall a cnt. Diff cnt => Difference cnt a -> a -> Difference cnt a
O(1). Append a single element.
- Modules
- Containers.
Difference