| bio-0.4.6: A bioinformatics library | Source code | Contents | Index
Bio.Location.OnSeq
Contents
Data types Utility functions Sequence collections indexed by name
Description
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.
Synopsis
type SeqName = SeqData
data OnSeq a = OnSeq {
onSeqName :: !SeqName
onSeqObj :: !a
}
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
type SeqName = SeqData | Source
Sequence name, as in a `Sequence`
data OnSeq a | Source
Data type for an object associated with a specific, named sequence
Constructors
OnSeq |
onSeqName :: !SeqName |
onSeqObj :: !a |
Instances
Functor OnSeq
Eq a => Eq (OnSeq a)
Ord a => Ord (OnSeq a)
Show a => Show (OnSeq a)
Utility functions
withSeqData | Source
:: 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 -> Bool | Source
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 c | Source
Performs an action when two objects are on the same sequence and produces an error otherwise.
Sequence collections indexed by name
type OnSeqs a = Map SeqName a | Source
Data type for a collection of objects indexed by sequence name
perSeq :: Monoid b => (a -> b -> c) -> OnSeq a -> OnSeqs b -> c | Source
Lifts a function on an underlying object to look up the sequence name in a name-indexed collection.
perSeqUpdate :: Monoid b => (a -> b -> b) -> OnSeq a -> OnSeqs b -> OnSeqs b | Source
Lifts a function that updates an underlying object to look up the named sequence and update a named-index collection.
withNameAndSeq :: Monad m => (SeqName -> a -> b -> m c) -> OnSeq a -> OnSeqs b -> m c | Source
Lifts a function on underlying objects to look up a sequence in a name-indexed collection
Produced by Haddock version 2.4.2