bio-0.4.6: A bioinformatics librarySource codeContentsIndex
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 = SeqDataSource
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
show/hide Instances
Functor OnSeq
Eq a => Eq (OnSeq a)
Ord a => Ord (OnSeq a)
Show a => Show (OnSeq a)
Utility functions
withSeqDataSource
:: Monad m
=> SeqData -> a -> m bFunction using sequence data
-> SeqName -> m SeqDataLookup sequence by name
-> OnSeq aObject 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
type OnSeqs a = Map SeqName aSource
Data type for a collection of objects indexed by sequence 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.
perSeqUpdate :: Monoid b => (a -> b -> b) -> OnSeq a -> OnSeqs b -> OnSeqs bSource
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 cSource
Lifts a function on underlying objects to look up a sequence in a name-indexed collection
Produced by Haddock version 2.6.1