prodapi-0.1.0.0: Some curated and opinionated packages for building Haskell services.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Prod.Tracer

Synopsis

Documentation

newtype Tracer m a Source #

Constructors

Tracer 

Fields

Instances

Instances details
Contravariant (Tracer m) Source # 
Instance details

Defined in Prod.Tracer

Methods

contramap :: (a' -> a) -> Tracer m a -> Tracer m a' #

(>$) :: b -> Tracer m b -> Tracer m a #

Applicative m => Decidable (Tracer m) Source # 
Instance details

Defined in Prod.Tracer

Methods

lose :: (a -> Void) -> Tracer m a #

choose :: (a -> Either b c) -> Tracer m b -> Tracer m c -> Tracer m a #

Applicative m => Divisible (Tracer m) Source # 
Instance details

Defined in Prod.Tracer

Methods

divide :: (a -> (b, c)) -> Tracer m b -> Tracer m c -> Tracer m a #

conquer :: Tracer m a #

silent :: Applicative m => Tracer m a Source #

Disable Tracing.

traceIf :: Applicative m => (a -> Bool) -> Tracer m a -> Tracer m a Source #

Filter by dynamically testing values.

traceBoth :: Applicative m => Tracer m a -> Tracer m a -> Tracer m a Source #

If you are given two tracers and want to pass both. Composition occurs in sequence.

common utilities

tracePrint :: (MonadIO m, Show a) => Tracer m a Source #

A tracer that prints emitted events.

traceHPrint :: (MonadIO m, Show a) => Handle -> Tracer m a Source #

A tracer that prints emitted to some handle.

traceHPut :: MonadIO m => Handle -> Tracer m ByteString Source #

A tracer that puts some ByteString to some handle.

encodeJSON :: ToJSON a => Tracer m ByteString -> Tracer m a Source #

A conversion encoding values to JSON.

pulls :: Monad m => (c -> m b) -> Tracer m b -> Tracer m c Source #

Pulls a value to complete a trace when a trace occurs.

This function allows to combines pushed values with pulled values. Hence, performing some scheduling between behaviours. Typical usage would be to annotate a trace with a background value, or perform data augmentation in a pipelines of traces.

Note that if you rely on this function you need to pay attention of the blocking effect of pulls: the traced value c is not forwarded until a value b is available.

re-exports

class Contravariant (f :: Type -> Type) where #

The class of contravariant functors.

Whereas in Haskell, one can think of a Functor as containing or producing values, a contravariant functor is a functor that can be thought of as consuming values.

As an example, consider the type of predicate functions a -> Bool. One such predicate might be negative x = x < 0, which classifies integers as to whether they are negative. However, given this predicate, we can re-use it in other situations, providing we have a way to map values to integers. For instance, we can use the negative predicate on a person's bank balance to work out if they are currently overdrawn:

newtype Predicate a = Predicate { getPredicate :: a -> Bool }

instance Contravariant Predicate where
  contramap :: (a' -> a) -> (Predicate a -> Predicate a')
  contramap f (Predicate p) = Predicate (p . f)
                                         |   `- First, map the input...
                                         `----- then apply the predicate.

overdrawn :: Predicate Person
overdrawn = contramap personBankBalance negative

Any instance should be subject to the following laws:

Identity
contramap id = id
Composition
contramap (g . f) = contramap f . contramap g

Note, that the second law follows from the free theorem of the type of contramap and the first law, so you need only check that the former condition holds.

Minimal complete definition

contramap

Methods

contramap :: (a' -> a) -> f a -> f a' #

(>$) :: b -> f b -> f a infixl 4 #

Replace all locations in the output with the same value. The default definition is contramap . const, but this may be overridden with a more efficient version.

Instances

Instances details
Contravariant ToJSONKeyFunction 
Instance details

Defined in Data.Aeson.Types.ToJSON

Contravariant Comparison

A Comparison is a Contravariant Functor, because contramap can apply its function argument to each input of the comparison function.

Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Comparison a -> Comparison a' #

(>$) :: b -> Comparison b -> Comparison a #

Contravariant Equivalence

Equivalence relations are Contravariant, because you can apply the contramapped function to each input to the equivalence relation.

Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Equivalence a -> Equivalence a' #

(>$) :: b -> Equivalence b -> Equivalence a #

Contravariant Predicate

A Predicate is a Contravariant Functor, because contramap can apply its function argument to the input of the predicate.

Without newtypes contramap f equals precomposing with f (= (. f)).

contramap :: (a' -> a) -> (Predicate a -> Predicate a')
contramap f (Predicate g) = Predicate (g . f)
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Predicate a -> Predicate a' #

(>$) :: b -> Predicate b -> Predicate a #

Contravariant (Op a) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a0) -> Op a a0 -> Op a a' #

(>$) :: b -> Op a b -> Op a a0 #

Contravariant (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Proxy a -> Proxy a' #

(>$) :: b -> Proxy b -> Proxy a #

Contravariant (U1 :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> U1 a -> U1 a' #

(>$) :: b -> U1 b -> U1 a #

Contravariant (V1 :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> V1 a -> V1 a' #

(>$) :: b -> V1 b -> V1 a #

Contravariant (Tracer m) Source # 
Instance details

Defined in Prod.Tracer

Methods

contramap :: (a' -> a) -> Tracer m a -> Tracer m a' #

(>$) :: b -> Tracer m b -> Tracer m a #

Contravariant m => Contravariant (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

contramap :: (a' -> a) -> MaybeT m a -> MaybeT m a' #

(>$) :: b -> MaybeT m b -> MaybeT m a #

Contravariant (Const a :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a0) -> Const a a0 -> Const a a' #

(>$) :: b -> Const a b -> Const a a0 #

Contravariant f => Contravariant (Alt f) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Alt f a -> Alt f a' #

(>$) :: b -> Alt f b -> Alt f a #

Contravariant f => Contravariant (Rec1 f) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Rec1 f a -> Rec1 f a' #

(>$) :: b -> Rec1 f b -> Rec1 f a #

Contravariant f => Contravariant (Backwards f)

Derived instance.

Instance details

Defined in Control.Applicative.Backwards

Methods

contramap :: (a' -> a) -> Backwards f a -> Backwards f a' #

(>$) :: b -> Backwards f b -> Backwards f a #

Contravariant m => Contravariant (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

contramap :: (a' -> a) -> ExceptT e m a -> ExceptT e m a' #

(>$) :: b -> ExceptT e m b -> ExceptT e m a #

Contravariant f => Contravariant (IdentityT f) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

contramap :: (a' -> a) -> IdentityT f a -> IdentityT f a' #

(>$) :: b -> IdentityT f b -> IdentityT f a #

Contravariant m => Contravariant (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

contramap :: (a' -> a) -> ReaderT r m a -> ReaderT r m a' #

(>$) :: b -> ReaderT r m b -> ReaderT r m a #

Contravariant m => Contravariant (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

contramap :: (a' -> a) -> StateT s m a -> StateT s m a' #

(>$) :: b -> StateT s m b -> StateT s m a #

Contravariant m => Contravariant (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Strict

Methods

contramap :: (a' -> a) -> StateT s m a -> StateT s m a' #

(>$) :: b -> StateT s m b -> StateT s m a #

Contravariant m => Contravariant (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

contramap :: (a' -> a) -> WriterT w m a -> WriterT w m a' #

(>$) :: b -> WriterT w m b -> WriterT w m a #

Contravariant m => Contravariant (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Strict

Methods

contramap :: (a' -> a) -> WriterT w m a -> WriterT w m a' #

(>$) :: b -> WriterT w m b -> WriterT w m a #

Contravariant (Constant a :: Type -> Type) 
Instance details

Defined in Data.Functor.Constant

Methods

contramap :: (a' -> a0) -> Constant a a0 -> Constant a a' #

(>$) :: b -> Constant a b -> Constant a a0 #

Contravariant f => Contravariant (Reverse f)

Derived instance.

Instance details

Defined in Data.Functor.Reverse

Methods

contramap :: (a' -> a) -> Reverse f a -> Reverse f a' #

(>$) :: b -> Reverse f b -> Reverse f a #

(Contravariant f, Contravariant g) => Contravariant (Product f g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Product f g a -> Product f g a' #

(>$) :: b -> Product f g b -> Product f g a #

(Contravariant f, Contravariant g) => Contravariant (Sum f g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Sum f g a -> Sum f g a' #

(>$) :: b -> Sum f g b -> Sum f g a #

(Contravariant f, Contravariant g) => Contravariant (f :*: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> (f :*: g) a -> (f :*: g) a' #

(>$) :: b -> (f :*: g) b -> (f :*: g) a #

(Contravariant f, Contravariant g) => Contravariant (f :+: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> (f :+: g) a -> (f :+: g) a' #

(>$) :: b -> (f :+: g) b -> (f :+: g) a #

Contravariant (K1 i c :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> K1 i c a -> K1 i c a' #

(>$) :: b -> K1 i c b -> K1 i c a #

(Functor f, Contravariant g) => Contravariant (Compose f g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Compose f g a -> Compose f g a' #

(>$) :: b -> Compose f g b -> Compose f g a #

(Functor f, Contravariant g) => Contravariant (f :.: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> (f :.: g) a -> (f :.: g) a' #

(>$) :: b -> (f :.: g) b -> (f :.: g) a #

Contravariant f => Contravariant (M1 i c f) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> M1 i c f a -> M1 i c f a' #

(>$) :: b -> M1 i c f b -> M1 i c f a #

Contravariant m => Contravariant (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Lazy

Methods

contramap :: (a' -> a) -> RWST r w s m a -> RWST r w s m a' #

(>$) :: b -> RWST r w s m b -> RWST r w s m a #

Contravariant m => Contravariant (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Strict

Methods

contramap :: (a' -> a) -> RWST r w s m a -> RWST r w s m a' #

(>$) :: b -> RWST r w s m b -> RWST r w s m a #

class Contravariant f => Divisible (f :: Type -> Type) where #

A Divisible contravariant functor is the contravariant analogue of Applicative.

Continuing the intuition that Contravariant functors consume input, a Divisible contravariant functor also has the ability to be composed "beside" another contravariant functor.

Serializers provide a good example of Divisible contravariant functors. To begin let's start with the type of serializers for specific types:

newtype Serializer a = Serializer { runSerializer :: a -> ByteString }

This is a contravariant functor:

instance Contravariant Serializer where
  contramap f s = Serializer (runSerializer s . f)

That is, given a serializer for a (s :: Serializer a), and a way to turn bs into as (a mapping f :: b -> a), we have a serializer for b: contramap f s :: Serializer b.

Divisible gives us a way to combine two serializers that focus on different parts of a structure. If we postulate the existance of two primitive serializers - string :: Serializer String and int :: Serializer Int, we would like to be able to combine these into a serializer for pairs of Strings and Ints. How can we do this? Simply run both serializers and combine their output!

data StringAndInt = StringAndInt String Int

stringAndInt :: Serializer StringAndInt
stringAndInt = Serializer $ \(StringAndInt s i) ->
  let sBytes = runSerializer string s
      iBytes = runSerializer int i
  in sBytes <> iBytes

divide is a generalization by also taking a contramap like function to split any a into a pair. This conveniently allows you to target fields of a record, for instance, by extracting the values under two fields and combining them into a tuple.

To complete the example, here is how to write stringAndInt using a Divisible instance:

instance Divisible Serializer where
  conquer = Serializer (const mempty)

  divide toBC bSerializer cSerializer = Serializer $ \a ->
    case toBC a of
      (b, c) ->
        let bBytes = runSerializer bSerializer b
            cBytes = runSerializer cSerializer c
        in bBytes <> cBytes

stringAndInt :: Serializer StringAndInt
stringAndInt =
  divide (\(StringAndInt s i) -> (s, i)) string int

Methods

divide :: (a -> (b, c)) -> f b -> f c -> f a #

conquer :: f a #

Conquer acts as an identity for combining Divisible functors.

Instances

Instances details
Divisible SettableStateVar 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Divisible Comparison 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Comparison b -> Comparison c -> Comparison a #

conquer :: Comparison a #

Divisible Equivalence 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Equivalence b -> Equivalence c -> Equivalence a #

conquer :: Equivalence a #

Divisible Predicate 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Predicate b -> Predicate c -> Predicate a #

conquer :: Predicate a #

Monoid r => Divisible (Op r) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Op r b -> Op r c -> Op r a #

conquer :: Op r a #

Divisible (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Proxy b -> Proxy c -> Proxy a #

conquer :: Proxy a #

Divisible (U1 :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> U1 b -> U1 c -> U1 a #

conquer :: U1 a #

Applicative m => Divisible (Tracer m) Source # 
Instance details

Defined in Prod.Tracer

Methods

divide :: (a -> (b, c)) -> Tracer m b -> Tracer m c -> Tracer m a #

conquer :: Tracer m a #

Divisible m => Divisible (MaybeT m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> MaybeT m b -> MaybeT m c -> MaybeT m a #

conquer :: MaybeT m a #

Monoid m => Divisible (Const m :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Const m b -> Const m c -> Const m a #

conquer :: Const m a #

Divisible f => Divisible (Alt f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Alt f b -> Alt f c -> Alt f a #

conquer :: Alt f a #

Divisible f => Divisible (Rec1 f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Rec1 f b -> Rec1 f c -> Rec1 f a #

conquer :: Rec1 f a #

Divisible f => Divisible (Backwards f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Backwards f b -> Backwards f c -> Backwards f a #

conquer :: Backwards f a #

Divisible m => Divisible (ExceptT e m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> ExceptT e m b -> ExceptT e m c -> ExceptT e m a #

conquer :: ExceptT e m a #

Divisible f => Divisible (IdentityT f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> IdentityT f b -> IdentityT f c -> IdentityT f a #

conquer :: IdentityT f a #

Divisible m => Divisible (ReaderT r m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> ReaderT r m b -> ReaderT r m c -> ReaderT r m a #

conquer :: ReaderT r m a #

Divisible m => Divisible (StateT s m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> StateT s m b -> StateT s m c -> StateT s m a #

conquer :: StateT s m a #

Divisible m => Divisible (StateT s m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> StateT s m b -> StateT s m c -> StateT s m a #

conquer :: StateT s m a #

Divisible m => Divisible (WriterT w m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> WriterT w m b -> WriterT w m c -> WriterT w m a #

conquer :: WriterT w m a #

Divisible m => Divisible (WriterT w m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> WriterT w m b -> WriterT w m c -> WriterT w m a #

conquer :: WriterT w m a #

Monoid m => Divisible (Constant m :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Constant m b -> Constant m c -> Constant m a #

conquer :: Constant m a #

Divisible f => Divisible (Reverse f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Reverse f b -> Reverse f c -> Reverse f a #

conquer :: Reverse f a #

(Divisible f, Divisible g) => Divisible (Product f g) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Product f g b -> Product f g c -> Product f g a #

conquer :: Product f g a #

(Divisible f, Divisible g) => Divisible (f :*: g) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> (f :*: g) b -> (f :*: g) c -> (f :*: g) a #

conquer :: (f :*: g) a #

(Applicative f, Divisible g) => Divisible (Compose f g) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> Compose f g b -> Compose f g c -> Compose f g a #

conquer :: Compose f g a #

(Applicative f, Divisible g) => Divisible (f :.: g) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> (f :.: g) b -> (f :.: g) c -> (f :.: g) a #

conquer :: (f :.: g) a #

Divisible f => Divisible (M1 i c f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c0)) -> M1 i c f b -> M1 i c f c0 -> M1 i c f a #

conquer :: M1 i c f a #

Divisible m => Divisible (RWST r w s m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> RWST r w s m b -> RWST r w s m c -> RWST r w s m a #

conquer :: RWST r w s m a #

Divisible m => Divisible (RWST r w s m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> RWST r w s m b -> RWST r w s m c -> RWST r w s m a #

conquer :: RWST r w s m a #

class Divisible f => Decidable (f :: Type -> Type) where #

A Decidable contravariant functor is the contravariant analogue of Alternative.

Noting the superclass constraint that f must also be Divisible, a Decidable functor has the ability to "fan out" input, under the intuition that contravariant functors consume input.

In the discussion for Divisible, an example was demonstrated with Serializers, that turn as into ByteStrings. Divisible allowed us to serialize the product of multiple values by concatenation. By making our Serializer also Decidable- we now have the ability to serialize the sum of multiple values - for example different constructors in an ADT.

Consider serializing arbitrary identifiers that can be either Strings or Ints:

data Identifier = StringId String | IntId Int

We know we have serializers for Strings and Ints, but how do we combine them into a Serializer for Identifier? Essentially, our Serializer needs to scrutinise the incoming value and choose how to serialize it:

identifier :: Serializer Identifier
identifier = Serializer $ \identifier ->
  case identifier of
    StringId s -> runSerializer string s
    IntId i -> runSerializer int i

It is exactly this notion of choice that Decidable encodes. Hence if we add an instance of Decidable for Serializer...

instance Decidable Serializer where
  lose f = Serializer $ \a -> absurd (f a)
  choose split l r = Serializer $ \a ->
    either (runSerializer l) (runSerializer r) (split a)

Then our identifier Serializer is

identifier :: Serializer Identifier
identifier = choose toEither string int where
  toEither (StringId s) = Left s
  toEither (IntId i) = Right i

Methods

lose :: (a -> Void) -> f a #

Acts as identity to choose.

choose :: (a -> Either b c) -> f b -> f c -> f a #

Instances

Instances details
Decidable SettableStateVar 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> SettableStateVar a #

choose :: (a -> Either b c) -> SettableStateVar b -> SettableStateVar c -> SettableStateVar a #

Decidable Comparison 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> Comparison a #

choose :: (a -> Either b c) -> Comparison b -> Comparison c -> Comparison a #

Decidable Equivalence 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> Equivalence a #

choose :: (a -> Either b c) -> Equivalence b -> Equivalence c -> Equivalence a #

Decidable Predicate 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> Predicate a #

choose :: (a -> Either b c) -> Predicate b -> Predicate c -> Predicate a #

Monoid r => Decidable (Op r) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> Op r a #

choose :: (a -> Either b c) -> Op r b -> Op r c -> Op r a #

Decidable (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> Proxy a #

choose :: (a -> Either b c) -> Proxy b -> Proxy c -> Proxy a #

Decidable (U1 :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> U1 a #

choose :: (a -> Either b c) -> U1 b -> U1 c -> U1 a #

Applicative m => Decidable (Tracer m) Source # 
Instance details

Defined in Prod.Tracer

Methods

lose :: (a -> Void) -> Tracer m a #

choose :: (a -> Either b c) -> Tracer m b -> Tracer m c -> Tracer m a #

Divisible m => Decidable (MaybeT m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> MaybeT m a #

choose :: (a -> Either b c) -> MaybeT m b -> MaybeT m c -> MaybeT m a #

Decidable f => Decidable (Alt f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> Alt f a #

choose :: (a -> Either b c) -> Alt f b -> Alt f c -> Alt f a #

Decidable f => Decidable (Rec1 f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> Rec1 f a #

choose :: (a -> Either b c) -> Rec1 f b -> Rec1 f c -> Rec1 f a #

Decidable f => Decidable (Backwards f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> Backwards f a #

choose :: (a -> Either b c) -> Backwards f b -> Backwards f c -> Backwards f a #

Decidable f => Decidable (IdentityT f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> IdentityT f a #

choose :: (a -> Either b c) -> IdentityT f b -> IdentityT f c -> IdentityT f a #

Decidable m => Decidable (ReaderT r m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> ReaderT r m a #

choose :: (a -> Either b c) -> ReaderT r m b -> ReaderT r m c -> ReaderT r m a #

Decidable m => Decidable (StateT s m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> StateT s m a #

choose :: (a -> Either b c) -> StateT s m b -> StateT s m c -> StateT s m a #

Decidable m => Decidable (StateT s m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> StateT s m a #

choose :: (a -> Either b c) -> StateT s m b -> StateT s m c -> StateT s m a #

Decidable m => Decidable (WriterT w m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> WriterT w m a #

choose :: (a -> Either b c) -> WriterT w m b -> WriterT w m c -> WriterT w m a #

Decidable m => Decidable (WriterT w m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> WriterT w m a #

choose :: (a -> Either b c) -> WriterT w m b -> WriterT w m c -> WriterT w m a #

Decidable f => Decidable (Reverse f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> Reverse f a #

choose :: (a -> Either b c) -> Reverse f b -> Reverse f c -> Reverse f a #

(Decidable f, Decidable g) => Decidable (Product f g) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> Product f g a #

choose :: (a -> Either b c) -> Product f g b -> Product f g c -> Product f g a #

(Decidable f, Decidable g) => Decidable (f :*: g) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> (f :*: g) a #

choose :: (a -> Either b c) -> (f :*: g) b -> (f :*: g) c -> (f :*: g) a #

(Applicative f, Decidable g) => Decidable (Compose f g) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> Compose f g a #

choose :: (a -> Either b c) -> Compose f g b -> Compose f g c -> Compose f g a #

(Applicative f, Decidable g) => Decidable (f :.: g) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> (f :.: g) a #

choose :: (a -> Either b c) -> (f :.: g) b -> (f :.: g) c -> (f :.: g) a #

Decidable f => Decidable (M1 i c f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> M1 i c f a #

choose :: (a -> Either b c0) -> M1 i c f b -> M1 i c f c0 -> M1 i c f a #

Decidable m => Decidable (RWST r w s m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> RWST r w s m a #

choose :: (a -> Either b c) -> RWST r w s m b -> RWST r w s m c -> RWST r w s m a #

Decidable m => Decidable (RWST r w s m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> RWST r w s m a #

choose :: (a -> Either b c) -> RWST r w s m b -> RWST r w s m c -> RWST r w s m a #