Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data BundleSection a
- value :: (MonoidBundle a, Ord (Base a)) => BundleSection a -> Base a -> a
- insert :: (AbelianBundle a, MonoidBundle a, Ord (Base a), Eq a) => a -> BundleSection a -> BundleSection a
- insertLeft :: (MonoidBundle a, Ord (Base a), Eq a) => a -> BundleSection a -> BundleSection a
- insertRight :: (MonoidBundle a, Ord (Base a), Eq a) => a -> BundleSection a -> BundleSection a
- fromList :: (AbelianBundle a, MonoidBundle a, Ord (Base a), Eq a) => [a] -> BundleSection a
- fromListLeft :: (MonoidBundle a, Ord (Base a), Eq a) => [a] -> BundleSection a
- fromListRight :: (MonoidBundle a, Ord (Base a), Eq a) => [a] -> BundleSection a
- map :: (AbelianBundle b, MonoidBundle b, Ord (Base b), Eq b) => BundleMorphism a b -> BundleSection a -> BundleSection b
- mapMonotonic :: (MonoidBundle b, Ord (Base b), Eq b) => BundleMorphism a b -> BundleSection a -> BundleSection b
- toList :: BundleSection a -> [a]
Bundle Sections
data BundleSection a Source #
A BundleSection
corresponds to a function f :: Base a -> a
such that
base . f = id
. In this encoding we only store values that are different
from a unit
.
Instances
value :: (MonoidBundle a, Ord (Base a)) => BundleSection a -> Base a -> a Source #
The underlying function of the BundleSection
.
Construction
insert :: (AbelianBundle a, MonoidBundle a, Ord (Base a), Eq a) => a -> BundleSection a -> BundleSection a Source #
Insert a value in a BundleSection
, by combining the given value to the
value that is present in the corresponding fiber. Synonym for insertLeft
,
simplified for when the operation is commutative.
insertLeft :: (MonoidBundle a, Ord (Base a), Eq a) => a -> BundleSection a -> BundleSection a Source #
Insert a value in a BundleSection
, by combining the given value to the
value that is present in the corresponding fiber. The new value is combined
from the left: new <> old
.
insertRight :: (MonoidBundle a, Ord (Base a), Eq a) => a -> BundleSection a -> BundleSection a Source #
Insert a value in a BundleSection
, by combining the given value to the
value that is present in the corresponding fiber. The new value is combined
from the right: old <> new
.
fromList :: (AbelianBundle a, MonoidBundle a, Ord (Base a), Eq a) => [a] -> BundleSection a Source #
Build a BundleSection
from a list of elements. Elements belonging to the
same fiber are combined. This is a synonym for fromListLeft
, simplified
for when the operation is commutative.
fromListLeft :: (MonoidBundle a, Ord (Base a), Eq a) => [a] -> BundleSection a Source #
Build a BundleSection
from a list of elements. Elements belonging to the
same fiber are combined. The new value is combined from the left: new <>
old
.
fromListRight :: (MonoidBundle a, Ord (Base a), Eq a) => [a] -> BundleSection a Source #
Build a BundleSection
from a list of elements. Elements belonging to the
same fiber are combined. The new value is combined from the right: old <>
new
.
Transformation
map :: (AbelianBundle b, MonoidBundle b, Ord (Base b), Eq b) => BundleMorphism a b -> BundleSection a -> BundleSection b Source #
Maps a BundleSection
from a MonoidBundle
to another. We expect the
BundleMorphism
to be a monoid morphism in each fiber.
Also, b
should be an AbelianBundle
since there is no guarantee on the
order on which fibers are combined.
WARNING: This function can error if the BundleMorphism
is not lawful.
mapMonotonic :: (MonoidBundle b, Ord (Base b), Eq b) => BundleMorphism a b -> BundleSection a -> BundleSection b Source #
The same as map
, but in the case where the Base
part of the
BundleMorphism
is monotonic. In this case the mapping between fibers is
injective. Therefore, there is no combination of different fibers and the
AbelianBundle
requisite can be dropped.
Destruction
toList :: BundleSection a -> [a] Source #
Retrieve all the non-unit values for the BundleSection
.