| Copyright | (c) Erich Gut |
|---|---|
| License | BSD3 |
| Maintainer | zerich.gut@gmail.com |
| Safe Haskell | None |
| Language | Haskell2010 |
OAlg.Entity.Sequence.FSequence
Description
Total sequences according to a index with finite support, i.e only finite many values are not equal to the default value.
The implementation is optimized for:
- retrieving the values by an index.
- values which may have a very time consuming evaluation.
Synopsis
- data FSequence (s :: Behavior) d i x
- data Behavior
- fsqIsEmpty :: forall d i x (s :: Behavior). (DefaultValue d i x, Eq x) => FSequence s d i x -> Bool
- fsqxs :: forall d i x (s :: Behavior). (DefaultValue d i x, Eq x) => FSequence s d i x -> [(x, i)]
- fsqx :: forall d i x (s :: Behavior). (DefaultValue d i x, Ord i) => FSequence s d i x -> i -> x
- fsqSpan :: forall d i x (s :: Behavior). (DefaultValue d i x, Eq x, Ord i) => FSequence s d i x -> Span i
- fsqMin :: forall d i x (s :: Behavior). (DefaultValue d i x, Eq x, Ord i) => FSequence s d i x -> Closure i
- fsqMax :: forall d i x (s :: Behavior). (DefaultValue d i x, Eq x, Ord i) => FSequence s d i x -> Closure i
- fsqD :: forall (s :: Behavior) d i x. FSequence s d i x -> d
- fsqForm :: forall d i x (s :: Behavior). (DefaultValue d i x, Eq x) => FSequence s d i x -> FSequenceForm d i x
- fsqMakeStrict :: (DefaultValue d i x, Eq x) => FSequenceForm d i x -> FSequence 'Strict d i x
- fsqMakeLazy :: FSequenceForm d i x -> FSequence 'Lazy d i x
- fsqMap :: forall d i y x (s :: Behavior). (DefaultValue d i y, Eq y) => (x -> y) -> FSequence s d i x -> FSequence s d i y
- fsqMapShift :: forall e i y d x (s :: Behavior). (DefaultValue e i y, Eq y, Number i) => (d -> e) -> i -> ((x, i) -> y) -> FSequence s d i x -> FSequence s e i y
- fsqMapWithIndex :: forall e j y d i x (s :: Behavior). (DefaultValue e j y, Eq y) => (d -> e) -> Monotone i j -> ((x, i) -> y) -> FSequence s d i x -> FSequence s e j y
- fsqMapWithIndexStrict :: (DefaultValue e j y, Eq y) => (d -> e) -> Monotone i j -> ((x, i) -> y) -> FSequence 'Strict d i x -> FSequence 'Strict e j y
- fsqMapWithIndexLazy :: (d -> e) -> Monotone i j -> ((x, i) -> y) -> FSequence 'Lazy d i x -> FSequence 'Lazy e j y
- fsqFilter :: forall x (s :: Behavior) d i. (x -> Bool) -> FSequence s d i x -> FSequence s d i x
- data FSequenceForm d i x = FSequenceForm d (PSequence i x)
- rdcFSequenceForm :: (DefaultValue d i x, Eq x) => FSequenceForm d i x -> FSequenceForm d i x
- class DefaultValue d i x where
- defaultValue :: d -> i -> x
- isDefaultValue :: (DefaultValue d i x, Eq x) => d -> (x, i) -> Bool
- relHomogenRoot :: forall d i x (s :: Behavior). (DefaultValue d i x, Fibred x, Show i) => FSequence s d i x -> Statement
- prpFSequenceSpan :: N -> Statement
- prpFSequence :: Statement
FSequence
data FSequence (s :: Behavior) d i x Source #
total sequence according to the index i with finite support, i.e only finite many values
are not equal to the default value according to a given index.
It comes with to flavors which defines the behavior of creating the sequence via make:
Strict: eliminates all default values from the form to create the sequence. In this case for
example the testing of equality is efficient.
Lazy: takes all the values form the form to create the sequence. In this case for example
the testing of equality is less efficient.
Both flavors have equal forms.
Instances
the evaluation behavior of a FSequence.
Instances
| Enum Behavior Source # | |
Defined in OAlg.Entity.Sequence.FSequence | |
| Show Behavior Source # | |
| Eq Behavior Source # | |
| Ord Behavior Source # | |
Defined in OAlg.Entity.Sequence.FSequence | |
fsqIsEmpty :: forall d i x (s :: Behavior). (DefaultValue d i x, Eq x) => FSequence s d i x -> Bool Source #
testing the first entry of being empty.
fsqxs :: forall d i x (s :: Behavior). (DefaultValue d i x, Eq x) => FSequence s d i x -> [(x, i)] Source #
the underlying list of non-default, indexed values,
fsqx :: forall d i x (s :: Behavior). (DefaultValue d i x, Ord i) => FSequence s d i x -> i -> x Source #
retrieving a value according to a given index.
fsqSpan :: forall d i x (s :: Behavior). (DefaultValue d i x, Eq x, Ord i) => FSequence s d i x -> Span i Source #
the support, i.e the minimal and the maximal index of the FSequence.
fsqMin :: forall d i x (s :: Behavior). (DefaultValue d i x, Eq x, Ord i) => FSequence s d i x -> Closure i Source #
the minimal index.
fsqMax :: forall d i x (s :: Behavior). (DefaultValue d i x, Eq x, Ord i) => FSequence s d i x -> Closure i Source #
the maxiaml index.
fsqForm :: forall d i x (s :: Behavior). (DefaultValue d i x, Eq x) => FSequence s d i x -> FSequenceForm d i x Source #
the underlying form.
fsqMakeStrict :: (DefaultValue d i x, Eq x) => FSequenceForm d i x -> FSequence 'Strict d i x Source #
makes a FSequence with a strict behavior.
fsqMakeLazy :: FSequenceForm d i x -> FSequence 'Lazy d i x Source #
makes a FSequence with a lazy behavior.
fsqMap :: forall d i y x (s :: Behavior). (DefaultValue d i y, Eq y) => (x -> y) -> FSequence s d i x -> FSequence s d i y Source #
maps a sequence according to the given mappings.
fsqMapShift :: forall e i y d x (s :: Behavior). (DefaultValue e i y, Eq y, Number i) => (d -> e) -> i -> ((x, i) -> y) -> FSequence s d i x -> FSequence s e i y Source #
maps a sequence according to the given mappings.
fsqMapWithIndex :: forall e j y d i x (s :: Behavior). (DefaultValue e j y, Eq y) => (d -> e) -> Monotone i j -> ((x, i) -> y) -> FSequence s d i x -> FSequence s e j y Source #
maps a sequence according to the given mappings.
fsqMapWithIndexStrict :: (DefaultValue e j y, Eq y) => (d -> e) -> Monotone i j -> ((x, i) -> y) -> FSequence 'Strict d i x -> FSequence 'Strict e j y Source #
maps a sequence according to the given mappings.
fsqMapWithIndexLazy :: (d -> e) -> Monotone i j -> ((x, i) -> y) -> FSequence 'Lazy d i x -> FSequence 'Lazy e j y Source #
maps a sequence according to the given mappings.
fsqFilter :: forall x (s :: Behavior) d i. (x -> Bool) -> FSequence s d i x -> FSequence s d i x Source #
the sub sequence all values satisfying the given predicate.
Form
data FSequenceForm d i x Source #
form for total sequences with finite support.
Constructors
| FSequenceForm d (PSequence i x) |
Instances
| (Show d, Show x, Show i) => Show (FSequenceForm d i x) Source # | |
Defined in OAlg.Entity.Sequence.FSequence Methods showsPrec :: Int -> FSequenceForm d i x -> ShowS # show :: FSequenceForm d i x -> String # showList :: [FSequenceForm d i x] -> ShowS # | |
| (Eq d, Eq x, Eq i) => Eq (FSequenceForm d i x) Source # | |
Defined in OAlg.Entity.Sequence.FSequence Methods (==) :: FSequenceForm d i x -> FSequenceForm d i x -> Bool # (/=) :: FSequenceForm d i x -> FSequenceForm d i x -> Bool # | |
| (Ord d, Ord x, Ord i) => Ord (FSequenceForm d i x) Source # | |
Defined in OAlg.Entity.Sequence.FSequence Methods compare :: FSequenceForm d i x -> FSequenceForm d i x -> Ordering # (<) :: FSequenceForm d i x -> FSequenceForm d i x -> Bool # (<=) :: FSequenceForm d i x -> FSequenceForm d i x -> Bool # (>) :: FSequenceForm d i x -> FSequenceForm d i x -> Bool # (>=) :: FSequenceForm d i x -> FSequenceForm d i x -> Bool # max :: FSequenceForm d i x -> FSequenceForm d i x -> FSequenceForm d i x # min :: FSequenceForm d i x -> FSequenceForm d i x -> FSequenceForm d i x # | |
| (Validable d, Entity i, Ord i, Entity x) => Validable (FSequenceForm d i x) Source # | |
Defined in OAlg.Entity.Sequence.FSequence Methods valid :: FSequenceForm d i x -> Statement Source # | |
| (Entity d, Entity i, Ord i, Entity x) => Fibred (FSequenceForm d i x) Source # | |
Defined in OAlg.Entity.Sequence.FSequence Methods root :: FSequenceForm d i x -> Root (FSequenceForm d i x) Source # | |
| Eq d => EqRoot (FSequenceForm d i x) Source # | |
Defined in OAlg.Entity.Sequence.FSequence | |
| Show d => ShowRoot (FSequenceForm d i x) Source # | |
Defined in OAlg.Entity.Sequence.FSequence | |
| Typeable d => TypeableRoot (FSequenceForm d i x) Source # | |
Defined in OAlg.Entity.Sequence.FSequence | |
| Validable d => ValidableRoot (FSequenceForm d i x) Source # | |
Defined in OAlg.Entity.Sequence.FSequence | |
| type Root (FSequenceForm d i x) Source # | |
Defined in OAlg.Entity.Sequence.FSequence | |
rdcFSequenceForm :: (DefaultValue d i x, Eq x) => FSequenceForm d i x -> FSequenceForm d i x Source #
reducing a sequence form, i.e. eliminates all default values according to the given index.
Default Value
class DefaultValue d i x where Source #
defining a default for every index.
Methods
defaultValue :: d -> i -> x Source #
isDefaultValue :: (DefaultValue d i x, Eq x) => d -> (x, i) -> Bool Source #
test for being the default value according to the given index.
Proposition
relHomogenRoot :: forall d i x (s :: Behavior). (DefaultValue d i x, Fibred x, Show i) => FSequence s d i x -> Statement Source #
prpFSequenceSpan :: N -> Statement Source #
support of the two flavors are equal.
prpFSequence :: Statement Source #
validating FSequence.