Search results

fmapL :: forall r e' e. (e -> e') -> Either e r -> Either e' r

Map a function over the Left value of an Either

mapLeft :: forall l r l2. (l -> l2) -> Either l r -> Either l2 r
coerce1 :: forall n a. Coercible n a => (a -> n) -> Either DecodeError a -> Either DecodeError n
lmap :: forall f a b c. Bifunctor f => (a -> b) -> f a c -> f b c

Map a function over the first type argument of a Bifunctor.

lcmap :: forall a b c p. Profunctor p => (a -> b) -> p b c -> p a c

Map a function over the (contravariant) first type argument only.

throwLeftAs :: forall err m left right. MonadThrow err m => (left -> err) -> Either left right -> m right

Turns a Left a into an exception which reduces nesting

dlmap :: forall p c b a. Profunctor p => (a -> b) -> p b c -> p a c
throwLeftAs :: forall err m left right. MonadThrow err m => (left -> err) -> Either left right -> m right

Turns a Left a into an exception which reduces nesting

handleEither :: forall r e' e. (e -> Either e' r) -> Either e r -> Either e' r

catchEither with the arguments flipped

wrapIso :: forall p t a. Profunctor p => Newtype t a => (a -> t) -> p a a -> p t t
wrapIso :: forall v1 v0 p. HasDimap Function p => Newtype v0 v1 => ObjectOf Function v1 => ObjectOf Function v0 => (v0 -> v1) -> p v0 v0 -> p v1 v1
rmap :: forall f a b c. Bifunctor f => (b -> c) -> f a b -> f a c

Map a function over the second type arguments of a Bifunctor.

rmap :: forall a b c p. Profunctor p => (b -> c) -> p a b -> p a c

Map a function over the (covariant) second type argument only.

drmap :: forall p c b a. Profunctor p => (b -> c) -> p a b -> p a c
fromLeft' :: forall a b. (Unit -> a) -> Either a b -> a

Similar to fromLeft but for use in cases where the default value may be expensive to compute. As PureScript is not lazy, the standard fromLeft has to evaluate the default value before returning the result, whereas here the value is only computed when the Either is known to be Right.

throwLeftAsM :: forall err m left right. MonadThrow err m => (left -> m err) -> Either left right -> m right

Turns a Left a into an exception which reduces nesting

throwLeftAsM :: forall err m left right. MonadThrow err m => (left -> m err) -> Either left right -> m right

Turns a Left a into an exception which reduces nesting

contramapMaybe :: forall p a b x. Profunctor p => Semigroupal Function Either Either Either p => (a -> Maybe b) -> p b x -> p a x
eitherBool :: forall a. (a -> Boolean) -> a -> Either a a

Upgrade a boolean-style predicate to an either-style predicate mapping.

fromRight' :: forall a b. (Unit -> b) -> Either a b -> b

Similar to fromRight but for use in cases where the default value may be expensive to compute. As PureScript is not lazy, the standard fromRight has to evaluate the default value before returning the result, whereas here the value is only computed when the Either is known to be Left.

try :: forall b a. (a -> b) -> a -> Either Error b
subst :: forall t f a c. Bound t => Monad f => (a -> f c) -> t f a -> t f c
substDefault :: forall t f a c. MonadTrans t => Monad f => Monad (t f) => (a -> f c) -> t f a -> t f c
censor :: forall w m a. MonadWriter w m => (w -> w) -> m a -> m a

Modify the final accumulator value by applying a function.

local :: forall e w a. ComonadEnv e w => (e -> e) -> w a -> w a
local :: forall r m a. MonadReader r m => (r -> r) -> m a -> m a
seeks :: forall s a w. ComonadStore s w => (s -> s) -> w a -> w a

Reposition the focus at the specified position, which depends on the current position.

censorAccum :: forall acc html a. Accum acc html => (acc -> acc) -> html a -> html a
setCtx :: forall ctx html a. Ctx ctx html => (ctx -> ctx) -> html a -> html a
mapErr :: forall e m a. MonadError e m => (e -> e) -> m a -> m a
resize :: forall m a. MonadGen m => (Size -> Size) -> m a -> m a

Modifies the size state for a random generator.

modCompleter :: forall f a. HasCompleter f => (Completer -> Completer) -> f a -> f a
defaultFilter :: forall a h f. BooleanEq h => Applicative f => Foldable f => Monoid (f a) => (a -> h) -> f a -> f a
filter :: forall f h a. Filterable f => BooleanEq h => (a -> h) -> f a -> f a
filter :: forall f a. Filterable f => (a -> Boolean) -> f a -> f a
filterDefault :: forall f a. Filterable f => (a -> Boolean) -> f a -> f a

A default implementation of filter using filterMap.

filterDefaultPartition :: forall f a. Filterable f => (a -> Boolean) -> f a -> f a

A default implementation of filter using partition.

filterDefaultPartitionMap :: forall f a. Filterable f => (a -> Boolean) -> f a -> f a

A default implementation of filter using partitionMap.

iterateUntil :: forall m a. Monad m => (a -> Boolean) -> m a -> m a

Execute an action repeatedly until its result satisfies a predicate, and return that result (discarding all others).

iterateUntil :: forall m a. MonadRec m => (a -> Boolean) -> m a -> m a

Execute an action repeatedly until its result satisfies a predicate, and return that result (discarding all others).

iterateWhile :: forall m a. Monad m => (a -> Boolean) -> m a -> m a

Execute an action repeatedly until its result fails to satisfy a predicate, and return that result (discarding all others).

iterateWhile :: forall m a. MonadRec m => (a -> Boolean) -> m a -> m a

Execute an action repeatedly until its result fails to satisfy a predicate, and return that result (discarding all others).

retryUntil :: forall m a. Monad m => (a -> Boolean) -> m a -> m a

Repeat a computation until the value satisfies a predicate

dropWhile :: forall f a. Container f => (a -> Boolean) -> f a -> f a
filter :: forall a b. HasFilter a => (b -> Boolean) -> a b -> a b
until :: forall a m. Monad m => (a -> Boolean) -> m a -> m a
shouldNotSatisfyM_Flipped :: forall m a. MonadThrow Error m => Show a => (a -> Boolean) -> m a -> m Unit
shouldSatisfyM_Flipped :: forall m a. MonadThrow Error m => Show a => (a -> Boolean) -> m a -> m Unit
liftA1 :: forall f a b. Applicative f => (a -> b) -> f a -> f b

liftA1 provides a default implementation of (<$>) for any Applicative functor, without using (<$>) as provided by the Functor-Applicative superclass relationship.

liftA1 can therefore be used to write Functor instances as follows:

instance functorF :: Functor F where
  map = liftA1
liftM1 :: forall m a b. Monad m => (a -> b) -> m a -> m b

liftM1 provides a default implementation of (<$>) for any Monad, without using (<$>) as provided by the Functor-Monad superclass relationship.

liftM1 can therefore be used to write Functor instances as follows:

instance functorF :: Functor F where
  map = liftM1