Hoogle Search
Within LTS Haskell 24.65 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
module Data.Functor.Contravariant.
Decide This module is only available if building with GHC 8.6 or later, or if the +contravariant cabal build flag is available.
class Contravariant f =>
Decide (f :: Type -> Type)semigroupoids Data.Functor.Contravariant.Decide The contravariant analogue of Alt. If one thinks of f a as a consumer of as, then decide allows one to handle the consumption of a value by choosing to handle it via exactly one of two independent consumers. It redirects the input completely into one of two consumers. decide takes the "decision" method and the two potential consumers, and returns the wrapped/combined consumer. Mathematically, a functor being an instance of Decide means that it is "semigroupoidal" with respect to the contravariant "either-based" Day convolution (data EitherDay f g a = forall b c. EitherDay (f b) (g c) (a -> Either b c)). That is, it is possible to define a function (f EitherDay f) a -> f a in a way that is associative.
decide :: Decide f => (a -> Either b c) -> f b -> f c -> f asemigroupoids Data.Functor.Contravariant.Decide Takes the "decision" method and the two potential consumers, and returns the wrapped/combined consumer.
decided :: Decide f => f b -> f c -> f (Either b c)semigroupoids Data.Functor.Contravariant.Decide For decided x y, the resulting f (Either b c) will direct Lefts to be consumed by x, and Rights to be consumed by y.
gdecide :: (Generic1 f, Decide (Rep1 f)) => (a -> Either b c) -> f b -> f c -> f asemigroupoids Data.Functor.Contravariant.Decide Generic decide. Caveats:
- Will not compile if f is a sum type.
- Will not compile if f contains fields that do not mention its type variable.
- -XDeriveGeneric is not smart enough to make instances where the type variable appears in negative position.
gdecided :: (Generic1 f, Decide (Rep1 f)) => f b -> f c -> f (Either b c)semigroupoids Data.Functor.Contravariant.Decide -
No documentation available.
class Semigroupoid k1 =>
Groupoid (k1 :: k -> k -> Type)semigroupoids Data.Groupoid semigroupoid with inverses. This technically should be a category with inverses, except we need to use Ob to define the valid objects for the category
-
A semigroupoid satisfies all of the requirements to be a Category except for the existence of identity arrows.
class
Semigroupoid (c :: k -> k -> Type)semigroupoids Data.Semigroupoid