FileSystem-1.0.0: File system data structure and monad transformer.

System.FileSystem.Utils

Synopsis

Documentation

bind :: Monad m => (a -> m b) -> m a -> m bSource

The =<< operator as a function.

combSource

Arguments

:: Applicative f 
=> (b -> c -> d)

The operator.

-> (a -> f b)

The first function.

-> (a -> f c)

The second function.

-> a -> f d

The resulting function.

The resulting function of comb is such that it applies two (possible) different functions to a single element, and combine both results with the given operator, inside of an Applicative container.

tup3 :: c -> (a, b) -> (a, b, c)Source

This function just adds a third component to a two-components tuple.

apget :: (Functor m, MonadState s m) => (s -> a) -> m aSource

Apply a function over the state, and return its result.

options :: (Functor m, Monad m) => [(a -> m Bool, a -> m b)] -> a -> m (Maybe b)Source

Given a list xs of pairs (monadic condition, monadic function), options xs applies to its argument the first function that satisfy the condition, and returns Nothing if no condition was satisfied.

(<|>) :: ArrowChoice f => f a b -> f c d -> f (Either a c) (Either b d)Source

An ArrowChoice operator. Given an arrow a ~> b and an arrow c ~> d:

 a ~> b <|> c ~> d
  = Either a c ~> Either b d    { (a ~> b) lifted with Left for Left values.
                          with -{          
                                { (c ~> d) lifted with Right for Right values.

Its name comes from the union of <$> and |||.

($$) :: (a -> a -> b) -> a -> bSource

This operator is similar to $, but the argument is used twice.

pairMap :: Arrow f => f a b -> f (a, a) (b, b)Source

Transforms a simple arrow to the same arrow applied to the two components of a pair.