Copyright | (c) Alexey Kuleshevich 2020 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <alexey@kuleshevi.ch> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- foldlMem :: forall e a mr. (Prim e, MemRead mr) => (a -> e -> a) -> a -> mr -> a
- ifoldlMem :: forall e a mr. (Prim e, MemRead mr) => (a -> Off e -> e -> a) -> a -> mr -> a
- ifoldlOffMem :: forall e a mr. (Prim e, MemRead mr) => Off e -> Count e -> (a -> Off e -> e -> a) -> a -> mr -> a
- foldlLazyMem :: forall e a mr. (Prim e, MemRead mr) => (a -> e -> a) -> a -> mr -> a
- ifoldlLazyMem :: forall e a mr. (Prim e, MemRead mr) => (a -> Off e -> e -> a) -> a -> mr -> a
- ifoldlLazyOffMem :: forall e a mr. (Prim e, MemRead mr) => Off e -> Count e -> (a -> Off e -> e -> a) -> a -> mr -> a
- foldrMem :: forall e a mr. (Prim e, MemRead mr) => (e -> a -> a) -> a -> mr -> a
- ifoldrMem :: forall e a mr. (Prim e, MemRead mr) => (Off e -> e -> a -> a) -> a -> mr -> a
- ifoldrOffMem :: forall e a mr. (Prim e, MemRead mr) => Off e -> Count e -> (Off e -> e -> a -> a) -> a -> mr -> a
- foldrLazyMem :: forall e a mr. (Prim e, MemRead mr) => (e -> a -> a) -> a -> mr -> a
- ifoldrLazyMem :: forall e a mr. (Prim e, MemRead mr) => (Off e -> e -> a -> a) -> a -> mr -> a
- ifoldrLazyOffMem :: forall e a mr. (Prim e, MemRead mr) => Off e -> Count e -> (Off e -> e -> a -> a) -> a -> mr -> a
- foldMapOffMem :: forall e m mr. (Prim e, MemRead mr, Monoid m) => Off e -> Count e -> (e -> m) -> mr -> m
- ifoldMapOffMem :: forall e m mr. (Prim e, MemRead mr, Monoid m) => Off e -> Count e -> (Off e -> e -> m) -> mr -> m
- anyOffMem :: forall e mr. (Prim e, MemRead mr) => Off e -> Count e -> (e -> Bool) -> mr -> Bool
- ianyOffMem :: forall e mr. (Prim e, MemRead mr) => Off e -> Count e -> (Off e -> e -> Bool) -> mr -> Bool
- anyMem :: forall e mr. (Prim e, MemRead mr) => (e -> Bool) -> mr -> Bool
- ianyMem :: forall e mr. (Prim e, MemRead mr) => (Off e -> e -> Bool) -> mr -> Bool
- allOffMem :: forall e mr. (Prim e, MemRead mr) => Off e -> Count e -> (e -> Bool) -> mr -> Bool
- iallOffMem :: forall e mr. (Prim e, MemRead mr) => Off e -> Count e -> (Off e -> e -> Bool) -> mr -> Bool
- allMem :: forall e mr. (Prim e, MemRead mr) => (e -> Bool) -> mr -> Bool
- iallMem :: forall e mr. (Prim e, MemRead mr) => (Off e -> e -> Bool) -> mr -> Bool
- eqMem :: forall e mr. (Prim e, Eq e, MemRead mr) => mr -> mr -> Bool
- eqOffMem :: (Prim e, Eq e, MemRead mr1, MemRead mr2) => mr1 -> Off e -> mr2 -> Off e -> Count e -> Bool
- eqOffMemBinary :: forall e mr1 mr2. (Prim e, MemRead mr1, MemRead mr2) => mr1 -> Off e -> mr2 -> Off e -> Count e -> Bool
- eqOffMutMem :: forall e ma1 ma2 m s. (Prim e, Eq e, MonadPrim s m, MemWrite ma1, MemWrite ma2) => ma1 s -> Off e -> ma2 s -> Off e -> Count e -> m Bool
- eqMutMem :: forall e ma m s. (Prim e, Eq e, MonadPrim s m, MemAlloc ma) => ma s -> ma s -> m Bool
- compareMem :: forall e mr. (Prim e, Ord e, MemRead mr) => mr -> mr -> Ordering
- compareOffMem :: (Prim e, Ord e, MemRead mr1, MemRead mr2) => mr1 -> Off e -> mr2 -> Off e -> Count e -> Ordering
Documentation
:: forall e a mr. (Prim e, MemRead mr) | |
=> (e -> a -> a) | Folding function |
-> a | Initial accumulator |
-> mr | Memory region to iterate over |
-> a |
Right fold with a lazy accumulator
Since: 0.3.0
:: forall e a mr. (Prim e, MemRead mr) | |
=> (Off e -> e -> a -> a) | Folding function |
-> a | Initial accumulator |
-> mr | Memory region to iterate over |
-> a |
Right fold with a lazy accumulator using an offset aware function
Since: 0.3.0
foldMapOffMem :: forall e m mr. (Prim e, MemRead mr, Monoid m) => Off e -> Count e -> (e -> m) -> mr -> m Source #
ifoldMapOffMem :: forall e m mr. (Prim e, MemRead mr, Monoid m) => Off e -> Count e -> (Off e -> e -> m) -> mr -> m Source #
anyOffMem :: forall e mr. (Prim e, MemRead mr) => Off e -> Count e -> (e -> Bool) -> mr -> Bool Source #
ianyOffMem :: forall e mr. (Prim e, MemRead mr) => Off e -> Count e -> (Off e -> e -> Bool) -> mr -> Bool Source #
allOffMem :: forall e mr. (Prim e, MemRead mr) => Off e -> Count e -> (e -> Bool) -> mr -> Bool Source #
iallOffMem :: forall e mr. (Prim e, MemRead mr) => Off e -> Count e -> (Off e -> e -> Bool) -> mr -> Bool Source #
:: (Prim e, Eq e, MemRead mr1, MemRead mr2) | |
=> mr1 | memRead1 - First region of memory |
-> Off e | memOff1 - Offset for Precondition: 0 <= memOff1 |
-> mr2 | memRead2 - Second region of memory |
-> Off e | memOff2 - Offset for Precondition: 0 <= memOff2 |
-> Count e | memCount - Number of elements of type Preconditions: 0 <= memCount offToCount memOff1 + memCount < countMem memRead1 offToCount memOff2 + memCount < countMem memRead2 |
-> Bool |
Check two regions of memory for equality using the Eq
instance. It will return
True
whenever both regions hold exactly the same elements and False
as soon as the
first pair of mismatched elements is discovered in the two regions. It is safe for both
regions to refer to the same part of memory.
- Unsafe
- When any precondition for either of the offsets
memOff1
,memOff2
or the element countmemCount
is violated the result is either unpredictable output or failure with a segfault.
Since: 0.3.0
eqOffMemBinary :: forall e mr1 mr2. (Prim e, MemRead mr1, MemRead mr2) => mr1 -> Off e -> mr2 -> Off e -> Count e -> Bool Source #
eqOffMutMem :: forall e ma1 ma2 m s. (Prim e, Eq e, MonadPrim s m, MemWrite ma1, MemWrite ma2) => ma1 s -> Off e -> ma2 s -> Off e -> Count e -> m Bool Source #
eqMutMem :: forall e ma m s. (Prim e, Eq e, MonadPrim s m, MemAlloc ma) => ma s -> ma s -> m Bool Source #
Compare two mutable memory regions for element equality. Regions themselves are not
modified, as such it is semantically similar to eqMem
which works on immutable
regions.
:: forall e mr. (Prim e, Ord e, MemRead mr) | |
=> mr | memRead1 - First region of memory |
-> mr | memRead2 - Second region of memory |
-> Ordering |
Compare two regions using the Ord
instance. It will return EQ
whenever both
regions hold exactly the same elements and LT
or GT
as soon as the first discovered
element that is less than or greater than respectfully in the first region when
compared to the second one. It is safe for both regions to refer to the same part of
memory.
Since: 0.3.0
:: (Prim e, Ord e, MemRead mr1, MemRead mr2) | |
=> mr1 | memRead1 - First region of memory |
-> Off e | memOff1 - Offset for Precondition: 0 <= memOff1 |
-> mr2 | memRead2 - Second region of memory |
-> Off e | memOff2 - Offset for Precondition: 0 <= memOff2 |
-> Count e | memCount - Number of elements of type Preconditions: 0 <= memCount offToCount memOff1 + memCount < countMem memRead1 offToCount memOff2 + memCount < countMem memRead2 |
-> Ordering |
Compare two regions using the Ord
instance. It will return EQ
whenever both
regions hold exactly the same elements and LT
or GT
as soon as the first discovered
element that is less than or greater than respectfully in the first region when
compared to the second one. It is safe for both regions to refer to the same part of
memory.
- Unsafe
- When any precondition for either of the offsets
memOff1
,memOff2
or the element countmemCount
is violated the result is either unpredictable output or failure with a segfault.
Since: 0.3.0