hsdev-0.3.1.3: Haskell development library

Safe HaskellSafe
LanguageHaskell98

Data.Deps

Synopsis

Documentation

newtype Deps a Source #

Dependency map

Constructors

Deps 

Fields

Instances

Show a => Show (Deps a) Source # 

Methods

showsPrec :: Int -> Deps a -> ShowS #

show :: Deps a -> String #

showList :: [Deps a] -> ShowS #

Ord a => Monoid (Deps a) Source # 

Methods

mempty :: Deps a #

mappend :: Deps a -> Deps a -> Deps a #

mconcat :: [Deps a] -> Deps a #

Ord a => Ixed (Deps a) Source # 

Methods

ix :: Index (Deps a) -> Traversal' (Deps a) (IxValue (Deps a)) #

Ord a => At (Deps a) Source # 

Methods

at :: Index (Deps a) -> Lens' (Deps a) (Maybe (IxValue (Deps a))) #

type Index (Deps a) Source # 
type Index (Deps a) = a
type IxValue (Deps a) Source # 
type IxValue (Deps a) = [a]

depsMap :: Lens (Deps a) (Deps b) (Map a [a]) (Map b [b]) Source #

mapDeps :: Ord b => (a -> b) -> Deps a -> Deps b Source #

dep :: a -> a -> Deps a Source #

Make single dependency

deps :: a -> [a] -> Deps a Source #

Make dependency for one target, note that order of dependencies is matter

inverse :: Ord a => Deps a -> Deps a Source #

Inverse dependencies, i.e. make map where keys are dependencies and elements are targets depends on it

newtype DepsError a Source #

Constructors

CyclicDeps [a]

Dependency cycle, list is cycle, where last item depends on first

flatten :: Ord a => Deps a -> Either (DepsError a) (Deps a) Source #

Flatten dependencies so that there will be no indirect dependencies

linearize :: Ord a => Deps a -> Either (DepsError a) [a] Source #

Linearize dependencies so that all items can be processed in this order, i.e. for each item all its dependencies goes before