Safe Haskell | Safe-Inferred |
---|

Data types for functorially lifting sequence positions and locations onto named sequences. These are useful for taking functions that work with sequence positions and locations and associating them specific, named sequences.

- type SeqName = SeqData
- data OnSeq a = OnSeq {}
- withSeqData :: Monad m => (SeqData -> a -> m b) -> (SeqName -> m SeqData) -> OnSeq a -> m b
- andSameSeq :: (a -> b -> Bool) -> OnSeq a -> OnSeq b -> Bool
- onSameSeq :: (Error e, MonadError e m) => (a -> b -> m c) -> OnSeq a -> OnSeq b -> m c
- type OnSeqs a = Map SeqName a
- perSeq :: Monoid b => (a -> b -> c) -> OnSeq a -> OnSeqs b -> c
- perSeqUpdate :: Monoid b => (a -> b -> b) -> OnSeq a -> OnSeqs b -> OnSeqs b
- withNameAndSeq :: Monad m => (SeqName -> a -> b -> m c) -> OnSeq a -> OnSeqs b -> m c

# Data types

Data type for an object associated with a specific, named sequence

# Utility functions

:: Monad m | |

=> (SeqData -> a -> m b) | Function using sequence data |

-> (SeqName -> m SeqData) | Lookup sequence by name |

-> OnSeq a | Object with named sequence |

-> m b |

Looks up a sequence by name and applies a function to it

andSameSeq :: (a -> b -> Bool) -> OnSeq a -> OnSeq b -> BoolSource

Tests a predicate when two objects are on the same sequence,
returning `False`

if they are on different sequences.

onSameSeq :: (Error e, MonadError e m) => (a -> b -> m c) -> OnSeq a -> OnSeq b -> m cSource

Performs an action when two objects are on the same sequence and produces an error otherwise.

# Sequence collections indexed by name

perSeq :: Monoid b => (a -> b -> c) -> OnSeq a -> OnSeqs b -> cSource

Lifts a function on an underlying object to look up the sequence name in a name-indexed collection.