| Copyright | ⓒ 2022 Anselm Schüler |
|---|---|
| License | MIT |
| Maintainer | mail@anselmschueler.com |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
| Extensions |
|
Data.Applicable
Description
The Applicable class with its operator ($*).
You will likely need the FlexibleContexts extension to use this module’s instances.
Synopsis
- class Applicable f a b | f a -> b where
- ($*) :: f -> a -> b
- newtype ApplyTo a = AppTo {
- unAppTo :: a
- newtype ApplyMap a b = AppMap {
- unAppMap :: a -> b
- newtype ApplyAp f a b = AppAp {
- unAppAp :: f (a -> b)
- newtype ApplyBind m a b = AppBind {
- unAppBind :: a -> m b
- newtype GroupAction a = GrpAct {
- unGrpAct :: a
- newtype ChurchBool = ChBool {}
- newtype ChurchNumeral a = ChNum {
- unChNum :: a
- newtype ChurchTuple a b = ChTup {
- unChTup :: (a, b)
Documentation
class Applicable f a b | f a -> b where Source #
A class for types whose values can be applied. Instances are required to be uniquely determined by the applied and applied-to type.
Instances
| Applicable ChurchBool a (a -> a) Source # | |
Defined in Data.Applicable Methods ($*) :: ChurchBool -> a -> a -> a Source # | |
| Semigroup a => Applicable (GroupAction a) a a Source # | |
Defined in Data.Applicable Methods ($*) :: GroupAction a -> a -> a Source # | |
| Applicable (ApplyTo a) (a -> b) b Source # | |
Defined in Data.Applicable | |
| Integral a => Applicable (ChurchNumeral a) (a -> a) (a -> a) Source # | |
Defined in Data.Applicable Methods ($*) :: ChurchNumeral a -> (a -> a) -> a -> a Source # | |
| Applicable (a -> b) a b Source # | |
Defined in Data.Applicable | |
| Functor f => Applicable (ApplyMap a b) (f a) (f b) Source # | |
Defined in Data.Applicable | |
| Applicable (ChurchTuple a b) (a -> b -> c) c Source # | |
Defined in Data.Applicable Methods ($*) :: ChurchTuple a b -> (a -> b -> c) -> c Source # | |
| Applicative f => Applicable (ApplyAp f a b) (f a) (f b) Source # | |
Defined in Data.Applicable | |
| Monad m => Applicable (ApplyBind m a b) (m a) (m b) Source # | |
Defined in Data.Applicable | |
A wrapper for values.
Can be applied to a function (->), applying the function to the inner value.
Instances
| Functor ApplyTo Source # | |
| Read a => Read (ApplyTo a) Source # | |
| Show a => Show (ApplyTo a) Source # | |
| Eq a => Eq (ApplyTo a) Source # | |
| Ord a => Ord (ApplyTo a) Source # | |
| Applicable (ApplyTo a) (a -> b) b Source # | |
Defined in Data.Applicable | |
Instances
newtype ApplyAp f a b Source #
A wrapper for functions in an applicative functor.
Can be applied to an Applicative functor, (<*>)-ing it on it.
Instances
| Functor f => Functor (ApplyAp f a) Source # | |
| Applicative f => Applicable (ApplyAp f a b) (f a) (f b) Source # | |
Defined in Data.Applicable | |
newtype GroupAction a Source #
A wrapper for Semigroup members, representing the associated group action.
Can be applied to another member, (<>)-ing them.
Instances
newtype ChurchBool Source #
A wrapper for Bools.
When applied to a value, uses the Church encoding of Booleans.
The Church encoding of Booleans is a binary function
that returns its first argument for True, and its second for False.
Instances
newtype ChurchNumeral a Source #
A wrapper for natural numbers (Approximated by Integral).
When applied to a value, uses the Church encoding of natural numbers.
Church numerals represent the number _n_ as a function that take another function and repeatedly applies it _n_ times.
Instances
newtype ChurchTuple a b Source #
A wrapper for tuples (,).
When applied to a value, uses the Church encoding of tuples.
The Church encoding of tuples applies a function to the values inside a tuple.