{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# OPTIONS_HADDOCK show-extensions #-}

-- |
-- Module: Data.Applicable
-- Description: The 'Applicable' class
-- Copyright: ⓒ 2022 Anselm Schüler
-- License: MIT
-- Maintainer: mail@anselmschueler.com
--
-- The 'Applicable' class with its operator '($*)'.
-- You will likely need the @FlexibleContexts@ extension to use this module’s instances.
module Data.Applicable
  ( Applicable (..),
    ApplyTo (..),
    FlapApply (..),
    BiFlapApply (..),
    ApplyMap (..),
    ApplyAp (..),
    ApplyBind (..),
    GroupAction (..),
    ChurchBool (..),
    ChurchNumeral (..),
    ChurchTuple (..),
  )
where

import Data.Bifunctor (Bifunctor (bimap))
import Data.Data (Data)
import Data.Ix (Ix)
import Data.List (genericIndex)
import GHC.Generics (Generic)

-- | A class for types whose values can be applied.
--   Instances are required to be uniquely determined by the applied and applied-to type.
class Applicable f a b | f a -> b where
  -- | Apply a value to another value, producing a result.
  ($*) :: f -> a -> b

instance Applicable (a -> b) a b where
  a -> b
f $* :: (a -> b) -> a -> b
$* a
x = a -> b
f a
x

-- | A wrapper for values.
--   Can be applied to a function, applying the function to the value.
newtype ApplyTo a = AppTo {forall a. ApplyTo a -> a
unAppTo :: a} deriving ((forall x. ApplyTo a -> Rep (ApplyTo a) x)
-> (forall x. Rep (ApplyTo a) x -> ApplyTo a)
-> Generic (ApplyTo a)
forall x. Rep (ApplyTo a) x -> ApplyTo a
forall x. ApplyTo a -> Rep (ApplyTo a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (ApplyTo a) x -> ApplyTo a
forall a x. ApplyTo a -> Rep (ApplyTo a) x
$cto :: forall a x. Rep (ApplyTo a) x -> ApplyTo a
$cfrom :: forall a x. ApplyTo a -> Rep (ApplyTo a) x
Generic, Typeable (ApplyTo a)
Typeable (ApplyTo a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ApplyTo a -> c (ApplyTo a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (ApplyTo a))
-> (ApplyTo a -> Constr)
-> (ApplyTo a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (ApplyTo a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (ApplyTo a)))
-> ((forall b. Data b => b -> b) -> ApplyTo a -> ApplyTo a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ApplyTo a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ApplyTo a -> r)
-> (forall u. (forall d. Data d => d -> u) -> ApplyTo a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ApplyTo a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a))
-> Data (ApplyTo a)
ApplyTo a -> DataType
ApplyTo a -> Constr
(forall b. Data b => b -> b) -> ApplyTo a -> ApplyTo a
forall {a}. Data a => Typeable (ApplyTo a)
forall a. Data a => ApplyTo a -> DataType
forall a. Data a => ApplyTo a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> ApplyTo a -> ApplyTo a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> ApplyTo a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> ApplyTo a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ApplyTo a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ApplyTo a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ApplyTo a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ApplyTo a -> c (ApplyTo a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ApplyTo a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ApplyTo a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ApplyTo a -> u
forall u. (forall d. Data d => d -> u) -> ApplyTo a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ApplyTo a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ApplyTo a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ApplyTo a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ApplyTo a -> c (ApplyTo a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ApplyTo a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ApplyTo a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> ApplyTo a -> m (ApplyTo a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ApplyTo a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> ApplyTo a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> ApplyTo a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> ApplyTo a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ApplyTo a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ApplyTo a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ApplyTo a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ApplyTo a -> r
gmapT :: (forall b. Data b => b -> b) -> ApplyTo a -> ApplyTo a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> ApplyTo a -> ApplyTo a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ApplyTo a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ApplyTo a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ApplyTo a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ApplyTo a))
dataTypeOf :: ApplyTo a -> DataType
$cdataTypeOf :: forall a. Data a => ApplyTo a -> DataType
toConstr :: ApplyTo a -> Constr
$ctoConstr :: forall a. Data a => ApplyTo a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ApplyTo a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ApplyTo a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ApplyTo a -> c (ApplyTo a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ApplyTo a -> c (ApplyTo a)
Data, ApplyTo a -> ApplyTo a -> Bool
(ApplyTo a -> ApplyTo a -> Bool)
-> (ApplyTo a -> ApplyTo a -> Bool) -> Eq (ApplyTo a)
forall a. Eq a => ApplyTo a -> ApplyTo a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplyTo a -> ApplyTo a -> Bool
$c/= :: forall a. Eq a => ApplyTo a -> ApplyTo a -> Bool
== :: ApplyTo a -> ApplyTo a -> Bool
$c== :: forall a. Eq a => ApplyTo a -> ApplyTo a -> Bool
Eq, Eq (ApplyTo a)
Eq (ApplyTo a)
-> (ApplyTo a -> ApplyTo a -> Ordering)
-> (ApplyTo a -> ApplyTo a -> Bool)
-> (ApplyTo a -> ApplyTo a -> Bool)
-> (ApplyTo a -> ApplyTo a -> Bool)
-> (ApplyTo a -> ApplyTo a -> Bool)
-> (ApplyTo a -> ApplyTo a -> ApplyTo a)
-> (ApplyTo a -> ApplyTo a -> ApplyTo a)
-> Ord (ApplyTo a)
ApplyTo a -> ApplyTo a -> Bool
ApplyTo a -> ApplyTo a -> Ordering
ApplyTo a -> ApplyTo a -> ApplyTo a
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall {a}. Ord a => Eq (ApplyTo a)
forall a. Ord a => ApplyTo a -> ApplyTo a -> Bool
forall a. Ord a => ApplyTo a -> ApplyTo a -> Ordering
forall a. Ord a => ApplyTo a -> ApplyTo a -> ApplyTo a
min :: ApplyTo a -> ApplyTo a -> ApplyTo a
$cmin :: forall a. Ord a => ApplyTo a -> ApplyTo a -> ApplyTo a
max :: ApplyTo a -> ApplyTo a -> ApplyTo a
$cmax :: forall a. Ord a => ApplyTo a -> ApplyTo a -> ApplyTo a
>= :: ApplyTo a -> ApplyTo a -> Bool
$c>= :: forall a. Ord a => ApplyTo a -> ApplyTo a -> Bool
> :: ApplyTo a -> ApplyTo a -> Bool
$c> :: forall a. Ord a => ApplyTo a -> ApplyTo a -> Bool
<= :: ApplyTo a -> ApplyTo a -> Bool
$c<= :: forall a. Ord a => ApplyTo a -> ApplyTo a -> Bool
< :: ApplyTo a -> ApplyTo a -> Bool
$c< :: forall a. Ord a => ApplyTo a -> ApplyTo a -> Bool
compare :: ApplyTo a -> ApplyTo a -> Ordering
$ccompare :: forall a. Ord a => ApplyTo a -> ApplyTo a -> Ordering
Ord, Int -> ApplyTo a -> ShowS
[ApplyTo a] -> ShowS
ApplyTo a -> String
(Int -> ApplyTo a -> ShowS)
-> (ApplyTo a -> String)
-> ([ApplyTo a] -> ShowS)
-> Show (ApplyTo a)
forall a. Show a => Int -> ApplyTo a -> ShowS
forall a. Show a => [ApplyTo a] -> ShowS
forall a. Show a => ApplyTo a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplyTo a] -> ShowS
$cshowList :: forall a. Show a => [ApplyTo a] -> ShowS
show :: ApplyTo a -> String
$cshow :: forall a. Show a => ApplyTo a -> String
showsPrec :: Int -> ApplyTo a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> ApplyTo a -> ShowS
Show, ReadPrec [ApplyTo a]
ReadPrec (ApplyTo a)
Int -> ReadS (ApplyTo a)
ReadS [ApplyTo a]
(Int -> ReadS (ApplyTo a))
-> ReadS [ApplyTo a]
-> ReadPrec (ApplyTo a)
-> ReadPrec [ApplyTo a]
-> Read (ApplyTo a)
forall a. Read a => ReadPrec [ApplyTo a]
forall a. Read a => ReadPrec (ApplyTo a)
forall a. Read a => Int -> ReadS (ApplyTo a)
forall a. Read a => ReadS [ApplyTo a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplyTo a]
$creadListPrec :: forall a. Read a => ReadPrec [ApplyTo a]
readPrec :: ReadPrec (ApplyTo a)
$creadPrec :: forall a. Read a => ReadPrec (ApplyTo a)
readList :: ReadS [ApplyTo a]
$creadList :: forall a. Read a => ReadS [ApplyTo a]
readsPrec :: Int -> ReadS (ApplyTo a)
$creadsPrec :: forall a. Read a => Int -> ReadS (ApplyTo a)
Read, Ord (ApplyTo a)
Ord (ApplyTo a)
-> ((ApplyTo a, ApplyTo a) -> [ApplyTo a])
-> ((ApplyTo a, ApplyTo a) -> ApplyTo a -> Int)
-> ((ApplyTo a, ApplyTo a) -> ApplyTo a -> Int)
-> ((ApplyTo a, ApplyTo a) -> ApplyTo a -> Bool)
-> ((ApplyTo a, ApplyTo a) -> Int)
-> ((ApplyTo a, ApplyTo a) -> Int)
-> Ix (ApplyTo a)
(ApplyTo a, ApplyTo a) -> Int
(ApplyTo a, ApplyTo a) -> [ApplyTo a]
(ApplyTo a, ApplyTo a) -> ApplyTo a -> Bool
(ApplyTo a, ApplyTo a) -> ApplyTo a -> Int
forall a.
Ord a
-> ((a, a) -> [a])
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Bool)
-> ((a, a) -> Int)
-> ((a, a) -> Int)
-> Ix a
forall {a}. Ix a => Ord (ApplyTo a)
forall a. Ix a => (ApplyTo a, ApplyTo a) -> Int
forall a. Ix a => (ApplyTo a, ApplyTo a) -> [ApplyTo a]
forall a. Ix a => (ApplyTo a, ApplyTo a) -> ApplyTo a -> Bool
forall a. Ix a => (ApplyTo a, ApplyTo a) -> ApplyTo a -> Int
unsafeRangeSize :: (ApplyTo a, ApplyTo a) -> Int
$cunsafeRangeSize :: forall a. Ix a => (ApplyTo a, ApplyTo a) -> Int
rangeSize :: (ApplyTo a, ApplyTo a) -> Int
$crangeSize :: forall a. Ix a => (ApplyTo a, ApplyTo a) -> Int
inRange :: (ApplyTo a, ApplyTo a) -> ApplyTo a -> Bool
$cinRange :: forall a. Ix a => (ApplyTo a, ApplyTo a) -> ApplyTo a -> Bool
unsafeIndex :: (ApplyTo a, ApplyTo a) -> ApplyTo a -> Int
$cunsafeIndex :: forall a. Ix a => (ApplyTo a, ApplyTo a) -> ApplyTo a -> Int
index :: (ApplyTo a, ApplyTo a) -> ApplyTo a -> Int
$cindex :: forall a. Ix a => (ApplyTo a, ApplyTo a) -> ApplyTo a -> Int
range :: (ApplyTo a, ApplyTo a) -> [ApplyTo a]
$crange :: forall a. Ix a => (ApplyTo a, ApplyTo a) -> [ApplyTo a]
Ix, (forall a b. (a -> b) -> ApplyTo a -> ApplyTo b)
-> (forall a b. a -> ApplyTo b -> ApplyTo a) -> Functor ApplyTo
forall a b. a -> ApplyTo b -> ApplyTo a
forall a b. (a -> b) -> ApplyTo a -> ApplyTo b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> ApplyTo b -> ApplyTo a
$c<$ :: forall a b. a -> ApplyTo b -> ApplyTo a
fmap :: forall a b. (a -> b) -> ApplyTo a -> ApplyTo b
$cfmap :: forall a b. (a -> b) -> ApplyTo a -> ApplyTo b
Functor, (forall m. Monoid m => ApplyTo m -> m)
-> (forall m a. Monoid m => (a -> m) -> ApplyTo a -> m)
-> (forall m a. Monoid m => (a -> m) -> ApplyTo a -> m)
-> (forall a b. (a -> b -> b) -> b -> ApplyTo a -> b)
-> (forall a b. (a -> b -> b) -> b -> ApplyTo a -> b)
-> (forall b a. (b -> a -> b) -> b -> ApplyTo a -> b)
-> (forall b a. (b -> a -> b) -> b -> ApplyTo a -> b)
-> (forall a. (a -> a -> a) -> ApplyTo a -> a)
-> (forall a. (a -> a -> a) -> ApplyTo a -> a)
-> (forall a. ApplyTo a -> [a])
-> (forall a. ApplyTo a -> Bool)
-> (forall a. ApplyTo a -> Int)
-> (forall a. Eq a => a -> ApplyTo a -> Bool)
-> (forall a. Ord a => ApplyTo a -> a)
-> (forall a. Ord a => ApplyTo a -> a)
-> (forall a. Num a => ApplyTo a -> a)
-> (forall a. Num a => ApplyTo a -> a)
-> Foldable ApplyTo
forall a. Eq a => a -> ApplyTo a -> Bool
forall a. Num a => ApplyTo a -> a
forall a. Ord a => ApplyTo a -> a
forall m. Monoid m => ApplyTo m -> m
forall a. ApplyTo a -> Bool
forall a. ApplyTo a -> Int
forall a. ApplyTo a -> [a]
forall a. (a -> a -> a) -> ApplyTo a -> a
forall m a. Monoid m => (a -> m) -> ApplyTo a -> m
forall b a. (b -> a -> b) -> b -> ApplyTo a -> b
forall a b. (a -> b -> b) -> b -> ApplyTo a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => ApplyTo a -> a
$cproduct :: forall a. Num a => ApplyTo a -> a
sum :: forall a. Num a => ApplyTo a -> a
$csum :: forall a. Num a => ApplyTo a -> a
minimum :: forall a. Ord a => ApplyTo a -> a
$cminimum :: forall a. Ord a => ApplyTo a -> a
maximum :: forall a. Ord a => ApplyTo a -> a
$cmaximum :: forall a. Ord a => ApplyTo a -> a
elem :: forall a. Eq a => a -> ApplyTo a -> Bool
$celem :: forall a. Eq a => a -> ApplyTo a -> Bool
length :: forall a. ApplyTo a -> Int
$clength :: forall a. ApplyTo a -> Int
null :: forall a. ApplyTo a -> Bool
$cnull :: forall a. ApplyTo a -> Bool
toList :: forall a. ApplyTo a -> [a]
$ctoList :: forall a. ApplyTo a -> [a]
foldl1 :: forall a. (a -> a -> a) -> ApplyTo a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> ApplyTo a -> a
foldr1 :: forall a. (a -> a -> a) -> ApplyTo a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> ApplyTo a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> ApplyTo a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> ApplyTo a -> b
foldl :: forall b a. (b -> a -> b) -> b -> ApplyTo a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> ApplyTo a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> ApplyTo a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> ApplyTo a -> b
foldr :: forall a b. (a -> b -> b) -> b -> ApplyTo a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> ApplyTo a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> ApplyTo a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> ApplyTo a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> ApplyTo a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> ApplyTo a -> m
fold :: forall m. Monoid m => ApplyTo m -> m
$cfold :: forall m. Monoid m => ApplyTo m -> m
Foldable, Functor ApplyTo
Foldable ApplyTo
Functor ApplyTo
-> Foldable ApplyTo
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ApplyTo a -> f (ApplyTo b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    ApplyTo (f a) -> f (ApplyTo a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ApplyTo a -> m (ApplyTo b))
-> (forall (m :: * -> *) a.
    Monad m =>
    ApplyTo (m a) -> m (ApplyTo a))
-> Traversable ApplyTo
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => ApplyTo (m a) -> m (ApplyTo a)
forall (f :: * -> *) a.
Applicative f =>
ApplyTo (f a) -> f (ApplyTo a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ApplyTo a -> m (ApplyTo b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ApplyTo a -> f (ApplyTo b)
sequence :: forall (m :: * -> *) a. Monad m => ApplyTo (m a) -> m (ApplyTo a)
$csequence :: forall (m :: * -> *) a. Monad m => ApplyTo (m a) -> m (ApplyTo a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ApplyTo a -> m (ApplyTo b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ApplyTo a -> m (ApplyTo b)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
ApplyTo (f a) -> f (ApplyTo a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
ApplyTo (f a) -> f (ApplyTo a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ApplyTo a -> f (ApplyTo b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ApplyTo a -> f (ApplyTo b)
Traversable)

instance Applicable (ApplyTo a) (a -> b) b where
  AppTo a
x $* :: ApplyTo a -> (a -> b) -> b
$* a -> b
f = a -> b
f a
x

-- | A wrapper for functions wrapped in a 'Functor'.
--   Can be applied to a value, 'fmap'-ing the application over the 'Functor'.
--
--   This nomenclature is borrowed from @relude@.
newtype FlapApply f a b = FlApp {forall (f :: * -> *) a b. FlapApply f a b -> f (a -> b)
unFlApp :: f (a -> b)} deriving ((forall x. FlapApply f a b -> Rep (FlapApply f a b) x)
-> (forall x. Rep (FlapApply f a b) x -> FlapApply f a b)
-> Generic (FlapApply f a b)
forall x. Rep (FlapApply f a b) x -> FlapApply f a b
forall x. FlapApply f a b -> Rep (FlapApply f a b) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (f :: * -> *) a b x.
Rep (FlapApply f a b) x -> FlapApply f a b
forall (f :: * -> *) a b x.
FlapApply f a b -> Rep (FlapApply f a b) x
$cto :: forall (f :: * -> *) a b x.
Rep (FlapApply f a b) x -> FlapApply f a b
$cfrom :: forall (f :: * -> *) a b x.
FlapApply f a b -> Rep (FlapApply f a b) x
Generic, (forall a b. (a -> b) -> FlapApply f a a -> FlapApply f a b)
-> (forall a b. a -> FlapApply f a b -> FlapApply f a a)
-> Functor (FlapApply f a)
forall a b. a -> FlapApply f a b -> FlapApply f a a
forall a b. (a -> b) -> FlapApply f a a -> FlapApply f a b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (f :: * -> *) a a b.
Functor f =>
a -> FlapApply f a b -> FlapApply f a a
forall (f :: * -> *) a a b.
Functor f =>
(a -> b) -> FlapApply f a a -> FlapApply f a b
<$ :: forall a b. a -> FlapApply f a b -> FlapApply f a a
$c<$ :: forall (f :: * -> *) a a b.
Functor f =>
a -> FlapApply f a b -> FlapApply f a a
fmap :: forall a b. (a -> b) -> FlapApply f a a -> FlapApply f a b
$cfmap :: forall (f :: * -> *) a a b.
Functor f =>
(a -> b) -> FlapApply f a a -> FlapApply f a b
Functor)

instance Functor f => Applicable (FlapApply f a b) a (f b) where
  FlApp f (a -> b)
fs $* :: FlapApply f a b -> a -> f b
$* a
x = ((a -> b) -> a -> b
forall a b. (a -> b) -> a -> b
$ a
x) ((a -> b) -> b) -> f (a -> b) -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> f (a -> b)
fs

-- | A wrapper for functions wrapped in a 'Bifunctor'.
--   Can be applied to a value, 'bimap'-ing the application over both fields.
newtype BiFlapApply f a b c = BiFlApp {forall (f :: * -> * -> *) a b c.
BiFlapApply f a b c -> f (a -> b) (a -> c)
unBiFlApp :: f (a -> b) (a -> c)} deriving (forall x. BiFlapApply f a b c -> Rep (BiFlapApply f a b c) x)
-> (forall x. Rep (BiFlapApply f a b c) x -> BiFlapApply f a b c)
-> Generic (BiFlapApply f a b c)
forall x. Rep (BiFlapApply f a b c) x -> BiFlapApply f a b c
forall x. BiFlapApply f a b c -> Rep (BiFlapApply f a b c) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (f :: * -> * -> *) a b c x.
Rep (BiFlapApply f a b c) x -> BiFlapApply f a b c
forall (f :: * -> * -> *) a b c x.
BiFlapApply f a b c -> Rep (BiFlapApply f a b c) x
$cto :: forall (f :: * -> * -> *) a b c x.
Rep (BiFlapApply f a b c) x -> BiFlapApply f a b c
$cfrom :: forall (f :: * -> * -> *) a b c x.
BiFlapApply f a b c -> Rep (BiFlapApply f a b c) x
Generic

instance Bifunctor f => Applicable (BiFlapApply f a b c) a (f b c) where
  BiFlApp f (a -> b) (a -> c)
fs $* :: BiFlapApply f a b c -> a -> f b c
$* a
x = ((a -> b) -> b) -> ((a -> c) -> c) -> f (a -> b) (a -> c) -> f b c
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap ((a -> b) -> a -> b
forall a b. (a -> b) -> a -> b
$ a
x) ((a -> c) -> a -> c
forall a b. (a -> b) -> a -> b
$ a
x) f (a -> b) (a -> c)
fs

-- | A wrapper for functions.
--   Can be applied to a 'Functor', 'fmap'-ing the function over the inner values.
newtype ApplyMap a b = AppMap {forall a b. ApplyMap a b -> a -> b
unAppMap :: a -> b} deriving ((forall x. ApplyMap a b -> Rep (ApplyMap a b) x)
-> (forall x. Rep (ApplyMap a b) x -> ApplyMap a b)
-> Generic (ApplyMap a b)
forall x. Rep (ApplyMap a b) x -> ApplyMap a b
forall x. ApplyMap a b -> Rep (ApplyMap a b) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a b x. Rep (ApplyMap a b) x -> ApplyMap a b
forall a b x. ApplyMap a b -> Rep (ApplyMap a b) x
$cto :: forall a b x. Rep (ApplyMap a b) x -> ApplyMap a b
$cfrom :: forall a b x. ApplyMap a b -> Rep (ApplyMap a b) x
Generic, (forall a b. (a -> b) -> ApplyMap a a -> ApplyMap a b)
-> (forall a b. a -> ApplyMap a b -> ApplyMap a a)
-> Functor (ApplyMap a)
forall a b. a -> ApplyMap a b -> ApplyMap a a
forall a b. (a -> b) -> ApplyMap a a -> ApplyMap a b
forall a a b. a -> ApplyMap a b -> ApplyMap a a
forall a a b. (a -> b) -> ApplyMap a a -> ApplyMap a b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> ApplyMap a b -> ApplyMap a a
$c<$ :: forall a a b. a -> ApplyMap a b -> ApplyMap a a
fmap :: forall a b. (a -> b) -> ApplyMap a a -> ApplyMap a b
$cfmap :: forall a a b. (a -> b) -> ApplyMap a a -> ApplyMap a b
Functor)

instance Functor f => Applicable (ApplyMap a b) (f a) (f b) where
  AppMap a -> b
f $* :: ApplyMap a b -> f a -> f b
$* f a
xa = a -> b
f (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> f a
xa

-- | A wrapper for functions in an applicative functor.
--   Can be applied to an 'Applicative' functor, '(<*>)'-ing it on it.
newtype ApplyAp f a b = AppAp {forall (f :: * -> *) a b. ApplyAp f a b -> f (a -> b)
unAppAp :: f (a -> b)} deriving ((forall x. ApplyAp f a b -> Rep (ApplyAp f a b) x)
-> (forall x. Rep (ApplyAp f a b) x -> ApplyAp f a b)
-> Generic (ApplyAp f a b)
forall x. Rep (ApplyAp f a b) x -> ApplyAp f a b
forall x. ApplyAp f a b -> Rep (ApplyAp f a b) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (f :: * -> *) a b x. Rep (ApplyAp f a b) x -> ApplyAp f a b
forall (f :: * -> *) a b x. ApplyAp f a b -> Rep (ApplyAp f a b) x
$cto :: forall (f :: * -> *) a b x. Rep (ApplyAp f a b) x -> ApplyAp f a b
$cfrom :: forall (f :: * -> *) a b x. ApplyAp f a b -> Rep (ApplyAp f a b) x
Generic, (forall a b. (a -> b) -> ApplyAp f a a -> ApplyAp f a b)
-> (forall a b. a -> ApplyAp f a b -> ApplyAp f a a)
-> Functor (ApplyAp f a)
forall a b. a -> ApplyAp f a b -> ApplyAp f a a
forall a b. (a -> b) -> ApplyAp f a a -> ApplyAp f a b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (f :: * -> *) a a b.
Functor f =>
a -> ApplyAp f a b -> ApplyAp f a a
forall (f :: * -> *) a a b.
Functor f =>
(a -> b) -> ApplyAp f a a -> ApplyAp f a b
<$ :: forall a b. a -> ApplyAp f a b -> ApplyAp f a a
$c<$ :: forall (f :: * -> *) a a b.
Functor f =>
a -> ApplyAp f a b -> ApplyAp f a a
fmap :: forall a b. (a -> b) -> ApplyAp f a a -> ApplyAp f a b
$cfmap :: forall (f :: * -> *) a a b.
Functor f =>
(a -> b) -> ApplyAp f a a -> ApplyAp f a b
Functor)

instance Applicative f => Applicable (ApplyAp f a b) (f a) (f b) where
  AppAp f (a -> b)
f $* :: ApplyAp f a b -> f a -> f b
$* f a
xa = f (a -> b)
f f (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> f a
xa

-- | A wrapper for 'Control.Arrow.Kleisli' arrows.
--   Can be applied to a 'Monad', '(>>=)'-ing it on it.
newtype ApplyBind m a b = AppBind {forall (m :: * -> *) a b. ApplyBind m a b -> a -> m b
unAppBind :: a -> m b} deriving ((forall x. ApplyBind m a b -> Rep (ApplyBind m a b) x)
-> (forall x. Rep (ApplyBind m a b) x -> ApplyBind m a b)
-> Generic (ApplyBind m a b)
forall x. Rep (ApplyBind m a b) x -> ApplyBind m a b
forall x. ApplyBind m a b -> Rep (ApplyBind m a b) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (m :: * -> *) a b x.
Rep (ApplyBind m a b) x -> ApplyBind m a b
forall (m :: * -> *) a b x.
ApplyBind m a b -> Rep (ApplyBind m a b) x
$cto :: forall (m :: * -> *) a b x.
Rep (ApplyBind m a b) x -> ApplyBind m a b
$cfrom :: forall (m :: * -> *) a b x.
ApplyBind m a b -> Rep (ApplyBind m a b) x
Generic, (forall a b. (a -> b) -> ApplyBind m a a -> ApplyBind m a b)
-> (forall a b. a -> ApplyBind m a b -> ApplyBind m a a)
-> Functor (ApplyBind m a)
forall a b. a -> ApplyBind m a b -> ApplyBind m a a
forall a b. (a -> b) -> ApplyBind m a a -> ApplyBind m a b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (m :: * -> *) a a b.
Functor m =>
a -> ApplyBind m a b -> ApplyBind m a a
forall (m :: * -> *) a a b.
Functor m =>
(a -> b) -> ApplyBind m a a -> ApplyBind m a b
<$ :: forall a b. a -> ApplyBind m a b -> ApplyBind m a a
$c<$ :: forall (m :: * -> *) a a b.
Functor m =>
a -> ApplyBind m a b -> ApplyBind m a a
fmap :: forall a b. (a -> b) -> ApplyBind m a a -> ApplyBind m a b
$cfmap :: forall (m :: * -> *) a a b.
Functor m =>
(a -> b) -> ApplyBind m a a -> ApplyBind m a b
Functor)

instance Monad m => Applicable (ApplyBind m a b) (m a) (m b) where
  AppBind a -> m b
f $* :: ApplyBind m a b -> m a -> m b
$* m a
xa = m a
xa m a -> (a -> m b) -> m b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= a -> m b
f

-- | A wrapper for 'Semigroup' members, representing the associated group action.
--   Can be applied to another member, '(<>)'-ing them.
newtype GroupAction a = GrpAct {forall a. GroupAction a -> a
unGrpAct :: a} deriving ((forall x. GroupAction a -> Rep (GroupAction a) x)
-> (forall x. Rep (GroupAction a) x -> GroupAction a)
-> Generic (GroupAction a)
forall x. Rep (GroupAction a) x -> GroupAction a
forall x. GroupAction a -> Rep (GroupAction a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (GroupAction a) x -> GroupAction a
forall a x. GroupAction a -> Rep (GroupAction a) x
$cto :: forall a x. Rep (GroupAction a) x -> GroupAction a
$cfrom :: forall a x. GroupAction a -> Rep (GroupAction a) x
Generic, Typeable (GroupAction a)
Typeable (GroupAction a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> GroupAction a -> c (GroupAction a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (GroupAction a))
-> (GroupAction a -> Constr)
-> (GroupAction a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (GroupAction a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (GroupAction a)))
-> ((forall b. Data b => b -> b) -> GroupAction a -> GroupAction a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> GroupAction a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> GroupAction a -> r)
-> (forall u. (forall d. Data d => d -> u) -> GroupAction a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> GroupAction a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> GroupAction a -> m (GroupAction a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> GroupAction a -> m (GroupAction a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> GroupAction a -> m (GroupAction a))
-> Data (GroupAction a)
GroupAction a -> DataType
GroupAction a -> Constr
(forall b. Data b => b -> b) -> GroupAction a -> GroupAction a
forall {a}. Data a => Typeable (GroupAction a)
forall a. Data a => GroupAction a -> DataType
forall a. Data a => GroupAction a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> GroupAction a -> GroupAction a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> GroupAction a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> GroupAction a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> GroupAction a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> GroupAction a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> GroupAction a -> m (GroupAction a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> GroupAction a -> m (GroupAction a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (GroupAction a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> GroupAction a -> c (GroupAction a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (GroupAction a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (GroupAction a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> GroupAction a -> u
forall u. (forall d. Data d => d -> u) -> GroupAction a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> GroupAction a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> GroupAction a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> GroupAction a -> m (GroupAction a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> GroupAction a -> m (GroupAction a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (GroupAction a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> GroupAction a -> c (GroupAction a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (GroupAction a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (GroupAction a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> GroupAction a -> m (GroupAction a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> GroupAction a -> m (GroupAction a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> GroupAction a -> m (GroupAction a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> GroupAction a -> m (GroupAction a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> GroupAction a -> m (GroupAction a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> GroupAction a -> m (GroupAction a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> GroupAction a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> GroupAction a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> GroupAction a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> GroupAction a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> GroupAction a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> GroupAction a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> GroupAction a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> GroupAction a -> r
gmapT :: (forall b. Data b => b -> b) -> GroupAction a -> GroupAction a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> GroupAction a -> GroupAction a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (GroupAction a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (GroupAction a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (GroupAction a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (GroupAction a))
dataTypeOf :: GroupAction a -> DataType
$cdataTypeOf :: forall a. Data a => GroupAction a -> DataType
toConstr :: GroupAction a -> Constr
$ctoConstr :: forall a. Data a => GroupAction a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (GroupAction a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (GroupAction a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> GroupAction a -> c (GroupAction a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> GroupAction a -> c (GroupAction a)
Data, GroupAction a -> GroupAction a -> Bool
(GroupAction a -> GroupAction a -> Bool)
-> (GroupAction a -> GroupAction a -> Bool) -> Eq (GroupAction a)
forall a. Eq a => GroupAction a -> GroupAction a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupAction a -> GroupAction a -> Bool
$c/= :: forall a. Eq a => GroupAction a -> GroupAction a -> Bool
== :: GroupAction a -> GroupAction a -> Bool
$c== :: forall a. Eq a => GroupAction a -> GroupAction a -> Bool
Eq, Eq (GroupAction a)
Eq (GroupAction a)
-> (GroupAction a -> GroupAction a -> Ordering)
-> (GroupAction a -> GroupAction a -> Bool)
-> (GroupAction a -> GroupAction a -> Bool)
-> (GroupAction a -> GroupAction a -> Bool)
-> (GroupAction a -> GroupAction a -> Bool)
-> (GroupAction a -> GroupAction a -> GroupAction a)
-> (GroupAction a -> GroupAction a -> GroupAction a)
-> Ord (GroupAction a)
GroupAction a -> GroupAction a -> Bool
GroupAction a -> GroupAction a -> Ordering
GroupAction a -> GroupAction a -> GroupAction a
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall {a}. Ord a => Eq (GroupAction a)
forall a. Ord a => GroupAction a -> GroupAction a -> Bool
forall a. Ord a => GroupAction a -> GroupAction a -> Ordering
forall a. Ord a => GroupAction a -> GroupAction a -> GroupAction a
min :: GroupAction a -> GroupAction a -> GroupAction a
$cmin :: forall a. Ord a => GroupAction a -> GroupAction a -> GroupAction a
max :: GroupAction a -> GroupAction a -> GroupAction a
$cmax :: forall a. Ord a => GroupAction a -> GroupAction a -> GroupAction a
>= :: GroupAction a -> GroupAction a -> Bool
$c>= :: forall a. Ord a => GroupAction a -> GroupAction a -> Bool
> :: GroupAction a -> GroupAction a -> Bool
$c> :: forall a. Ord a => GroupAction a -> GroupAction a -> Bool
<= :: GroupAction a -> GroupAction a -> Bool
$c<= :: forall a. Ord a => GroupAction a -> GroupAction a -> Bool
< :: GroupAction a -> GroupAction a -> Bool
$c< :: forall a. Ord a => GroupAction a -> GroupAction a -> Bool
compare :: GroupAction a -> GroupAction a -> Ordering
$ccompare :: forall a. Ord a => GroupAction a -> GroupAction a -> Ordering
Ord, Int -> GroupAction a -> ShowS
[GroupAction a] -> ShowS
GroupAction a -> String
(Int -> GroupAction a -> ShowS)
-> (GroupAction a -> String)
-> ([GroupAction a] -> ShowS)
-> Show (GroupAction a)
forall a. Show a => Int -> GroupAction a -> ShowS
forall a. Show a => [GroupAction a] -> ShowS
forall a. Show a => GroupAction a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupAction a] -> ShowS
$cshowList :: forall a. Show a => [GroupAction a] -> ShowS
show :: GroupAction a -> String
$cshow :: forall a. Show a => GroupAction a -> String
showsPrec :: Int -> GroupAction a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> GroupAction a -> ShowS
Show, ReadPrec [GroupAction a]
ReadPrec (GroupAction a)
Int -> ReadS (GroupAction a)
ReadS [GroupAction a]
(Int -> ReadS (GroupAction a))
-> ReadS [GroupAction a]
-> ReadPrec (GroupAction a)
-> ReadPrec [GroupAction a]
-> Read (GroupAction a)
forall a. Read a => ReadPrec [GroupAction a]
forall a. Read a => ReadPrec (GroupAction a)
forall a. Read a => Int -> ReadS (GroupAction a)
forall a. Read a => ReadS [GroupAction a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupAction a]
$creadListPrec :: forall a. Read a => ReadPrec [GroupAction a]
readPrec :: ReadPrec (GroupAction a)
$creadPrec :: forall a. Read a => ReadPrec (GroupAction a)
readList :: ReadS [GroupAction a]
$creadList :: forall a. Read a => ReadS [GroupAction a]
readsPrec :: Int -> ReadS (GroupAction a)
$creadsPrec :: forall a. Read a => Int -> ReadS (GroupAction a)
Read, Ord (GroupAction a)
Ord (GroupAction a)
-> ((GroupAction a, GroupAction a) -> [GroupAction a])
-> ((GroupAction a, GroupAction a) -> GroupAction a -> Int)
-> ((GroupAction a, GroupAction a) -> GroupAction a -> Int)
-> ((GroupAction a, GroupAction a) -> GroupAction a -> Bool)
-> ((GroupAction a, GroupAction a) -> Int)
-> ((GroupAction a, GroupAction a) -> Int)
-> Ix (GroupAction a)
(GroupAction a, GroupAction a) -> Int
(GroupAction a, GroupAction a) -> [GroupAction a]
(GroupAction a, GroupAction a) -> GroupAction a -> Bool
(GroupAction a, GroupAction a) -> GroupAction a -> Int
forall a.
Ord a
-> ((a, a) -> [a])
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Bool)
-> ((a, a) -> Int)
-> ((a, a) -> Int)
-> Ix a
forall {a}. Ix a => Ord (GroupAction a)
forall a. Ix a => (GroupAction a, GroupAction a) -> Int
forall a. Ix a => (GroupAction a, GroupAction a) -> [GroupAction a]
forall a.
Ix a =>
(GroupAction a, GroupAction a) -> GroupAction a -> Bool
forall a.
Ix a =>
(GroupAction a, GroupAction a) -> GroupAction a -> Int
unsafeRangeSize :: (GroupAction a, GroupAction a) -> Int
$cunsafeRangeSize :: forall a. Ix a => (GroupAction a, GroupAction a) -> Int
rangeSize :: (GroupAction a, GroupAction a) -> Int
$crangeSize :: forall a. Ix a => (GroupAction a, GroupAction a) -> Int
inRange :: (GroupAction a, GroupAction a) -> GroupAction a -> Bool
$cinRange :: forall a.
Ix a =>
(GroupAction a, GroupAction a) -> GroupAction a -> Bool
unsafeIndex :: (GroupAction a, GroupAction a) -> GroupAction a -> Int
$cunsafeIndex :: forall a.
Ix a =>
(GroupAction a, GroupAction a) -> GroupAction a -> Int
index :: (GroupAction a, GroupAction a) -> GroupAction a -> Int
$cindex :: forall a.
Ix a =>
(GroupAction a, GroupAction a) -> GroupAction a -> Int
range :: (GroupAction a, GroupAction a) -> [GroupAction a]
$crange :: forall a. Ix a => (GroupAction a, GroupAction a) -> [GroupAction a]
Ix, (forall a b. (a -> b) -> GroupAction a -> GroupAction b)
-> (forall a b. a -> GroupAction b -> GroupAction a)
-> Functor GroupAction
forall a b. a -> GroupAction b -> GroupAction a
forall a b. (a -> b) -> GroupAction a -> GroupAction b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> GroupAction b -> GroupAction a
$c<$ :: forall a b. a -> GroupAction b -> GroupAction a
fmap :: forall a b. (a -> b) -> GroupAction a -> GroupAction b
$cfmap :: forall a b. (a -> b) -> GroupAction a -> GroupAction b
Functor, (forall m. Monoid m => GroupAction m -> m)
-> (forall m a. Monoid m => (a -> m) -> GroupAction a -> m)
-> (forall m a. Monoid m => (a -> m) -> GroupAction a -> m)
-> (forall a b. (a -> b -> b) -> b -> GroupAction a -> b)
-> (forall a b. (a -> b -> b) -> b -> GroupAction a -> b)
-> (forall b a. (b -> a -> b) -> b -> GroupAction a -> b)
-> (forall b a. (b -> a -> b) -> b -> GroupAction a -> b)
-> (forall a. (a -> a -> a) -> GroupAction a -> a)
-> (forall a. (a -> a -> a) -> GroupAction a -> a)
-> (forall a. GroupAction a -> [a])
-> (forall a. GroupAction a -> Bool)
-> (forall a. GroupAction a -> Int)
-> (forall a. Eq a => a -> GroupAction a -> Bool)
-> (forall a. Ord a => GroupAction a -> a)
-> (forall a. Ord a => GroupAction a -> a)
-> (forall a. Num a => GroupAction a -> a)
-> (forall a. Num a => GroupAction a -> a)
-> Foldable GroupAction
forall a. Eq a => a -> GroupAction a -> Bool
forall a. Num a => GroupAction a -> a
forall a. Ord a => GroupAction a -> a
forall m. Monoid m => GroupAction m -> m
forall a. GroupAction a -> Bool
forall a. GroupAction a -> Int
forall a. GroupAction a -> [a]
forall a. (a -> a -> a) -> GroupAction a -> a
forall m a. Monoid m => (a -> m) -> GroupAction a -> m
forall b a. (b -> a -> b) -> b -> GroupAction a -> b
forall a b. (a -> b -> b) -> b -> GroupAction a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => GroupAction a -> a
$cproduct :: forall a. Num a => GroupAction a -> a
sum :: forall a. Num a => GroupAction a -> a
$csum :: forall a. Num a => GroupAction a -> a
minimum :: forall a. Ord a => GroupAction a -> a
$cminimum :: forall a. Ord a => GroupAction a -> a
maximum :: forall a. Ord a => GroupAction a -> a
$cmaximum :: forall a. Ord a => GroupAction a -> a
elem :: forall a. Eq a => a -> GroupAction a -> Bool
$celem :: forall a. Eq a => a -> GroupAction a -> Bool
length :: forall a. GroupAction a -> Int
$clength :: forall a. GroupAction a -> Int
null :: forall a. GroupAction a -> Bool
$cnull :: forall a. GroupAction a -> Bool
toList :: forall a. GroupAction a -> [a]
$ctoList :: forall a. GroupAction a -> [a]
foldl1 :: forall a. (a -> a -> a) -> GroupAction a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> GroupAction a -> a
foldr1 :: forall a. (a -> a -> a) -> GroupAction a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> GroupAction a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> GroupAction a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> GroupAction a -> b
foldl :: forall b a. (b -> a -> b) -> b -> GroupAction a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> GroupAction a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> GroupAction a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> GroupAction a -> b
foldr :: forall a b. (a -> b -> b) -> b -> GroupAction a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> GroupAction a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> GroupAction a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> GroupAction a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> GroupAction a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> GroupAction a -> m
fold :: forall m. Monoid m => GroupAction m -> m
$cfold :: forall m. Monoid m => GroupAction m -> m
Foldable, Functor GroupAction
Foldable GroupAction
Functor GroupAction
-> Foldable GroupAction
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> GroupAction a -> f (GroupAction b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    GroupAction (f a) -> f (GroupAction a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> GroupAction a -> m (GroupAction b))
-> (forall (m :: * -> *) a.
    Monad m =>
    GroupAction (m a) -> m (GroupAction a))
-> Traversable GroupAction
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
GroupAction (m a) -> m (GroupAction a)
forall (f :: * -> *) a.
Applicative f =>
GroupAction (f a) -> f (GroupAction a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GroupAction a -> m (GroupAction b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GroupAction a -> f (GroupAction b)
sequence :: forall (m :: * -> *) a.
Monad m =>
GroupAction (m a) -> m (GroupAction a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
GroupAction (m a) -> m (GroupAction a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GroupAction a -> m (GroupAction b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GroupAction a -> m (GroupAction b)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
GroupAction (f a) -> f (GroupAction a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
GroupAction (f a) -> f (GroupAction a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GroupAction a -> f (GroupAction b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GroupAction a -> f (GroupAction b)
Traversable)

instance Semigroup a => Applicable (GroupAction a) a a where
  GrpAct a
a $* :: GroupAction a -> a -> a
$* a
b = a
a a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
b

-- | A wrapper for 'Bool's.
--   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'.
newtype ChurchBool = ChBool {ChurchBool -> Bool
unChBool :: Bool} deriving ((forall x. ChurchBool -> Rep ChurchBool x)
-> (forall x. Rep ChurchBool x -> ChurchBool) -> Generic ChurchBool
forall x. Rep ChurchBool x -> ChurchBool
forall x. ChurchBool -> Rep ChurchBool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChurchBool x -> ChurchBool
$cfrom :: forall x. ChurchBool -> Rep ChurchBool x
Generic, Typeable ChurchBool
Typeable ChurchBool
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ChurchBool -> c ChurchBool)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ChurchBool)
-> (ChurchBool -> Constr)
-> (ChurchBool -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ChurchBool))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ChurchBool))
-> ((forall b. Data b => b -> b) -> ChurchBool -> ChurchBool)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ChurchBool -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ChurchBool -> r)
-> (forall u. (forall d. Data d => d -> u) -> ChurchBool -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ChurchBool -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ChurchBool -> m ChurchBool)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ChurchBool -> m ChurchBool)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ChurchBool -> m ChurchBool)
-> Data ChurchBool
ChurchBool -> DataType
ChurchBool -> Constr
(forall b. Data b => b -> b) -> ChurchBool -> ChurchBool
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ChurchBool -> u
forall u. (forall d. Data d => d -> u) -> ChurchBool -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchBool -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchBool -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ChurchBool -> m ChurchBool
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChurchBool -> m ChurchBool
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChurchBool
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChurchBool -> c ChurchBool
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChurchBool)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ChurchBool)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChurchBool -> m ChurchBool
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChurchBool -> m ChurchBool
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChurchBool -> m ChurchBool
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChurchBool -> m ChurchBool
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ChurchBool -> m ChurchBool
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ChurchBool -> m ChurchBool
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ChurchBool -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ChurchBool -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> ChurchBool -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ChurchBool -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchBool -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchBool -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchBool -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchBool -> r
gmapT :: (forall b. Data b => b -> b) -> ChurchBool -> ChurchBool
$cgmapT :: (forall b. Data b => b -> b) -> ChurchBool -> ChurchBool
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ChurchBool)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ChurchBool)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChurchBool)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChurchBool)
dataTypeOf :: ChurchBool -> DataType
$cdataTypeOf :: ChurchBool -> DataType
toConstr :: ChurchBool -> Constr
$ctoConstr :: ChurchBool -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChurchBool
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChurchBool
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChurchBool -> c ChurchBool
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChurchBool -> c ChurchBool
Data, ChurchBool -> ChurchBool -> Bool
(ChurchBool -> ChurchBool -> Bool)
-> (ChurchBool -> ChurchBool -> Bool) -> Eq ChurchBool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChurchBool -> ChurchBool -> Bool
$c/= :: ChurchBool -> ChurchBool -> Bool
== :: ChurchBool -> ChurchBool -> Bool
$c== :: ChurchBool -> ChurchBool -> Bool
Eq, Eq ChurchBool
Eq ChurchBool
-> (ChurchBool -> ChurchBool -> Ordering)
-> (ChurchBool -> ChurchBool -> Bool)
-> (ChurchBool -> ChurchBool -> Bool)
-> (ChurchBool -> ChurchBool -> Bool)
-> (ChurchBool -> ChurchBool -> Bool)
-> (ChurchBool -> ChurchBool -> ChurchBool)
-> (ChurchBool -> ChurchBool -> ChurchBool)
-> Ord ChurchBool
ChurchBool -> ChurchBool -> Bool
ChurchBool -> ChurchBool -> Ordering
ChurchBool -> ChurchBool -> ChurchBool
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChurchBool -> ChurchBool -> ChurchBool
$cmin :: ChurchBool -> ChurchBool -> ChurchBool
max :: ChurchBool -> ChurchBool -> ChurchBool
$cmax :: ChurchBool -> ChurchBool -> ChurchBool
>= :: ChurchBool -> ChurchBool -> Bool
$c>= :: ChurchBool -> ChurchBool -> Bool
> :: ChurchBool -> ChurchBool -> Bool
$c> :: ChurchBool -> ChurchBool -> Bool
<= :: ChurchBool -> ChurchBool -> Bool
$c<= :: ChurchBool -> ChurchBool -> Bool
< :: ChurchBool -> ChurchBool -> Bool
$c< :: ChurchBool -> ChurchBool -> Bool
compare :: ChurchBool -> ChurchBool -> Ordering
$ccompare :: ChurchBool -> ChurchBool -> Ordering
Ord, Int -> ChurchBool -> ShowS
[ChurchBool] -> ShowS
ChurchBool -> String
(Int -> ChurchBool -> ShowS)
-> (ChurchBool -> String)
-> ([ChurchBool] -> ShowS)
-> Show ChurchBool
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChurchBool] -> ShowS
$cshowList :: [ChurchBool] -> ShowS
show :: ChurchBool -> String
$cshow :: ChurchBool -> String
showsPrec :: Int -> ChurchBool -> ShowS
$cshowsPrec :: Int -> ChurchBool -> ShowS
Show, ReadPrec [ChurchBool]
ReadPrec ChurchBool
Int -> ReadS ChurchBool
ReadS [ChurchBool]
(Int -> ReadS ChurchBool)
-> ReadS [ChurchBool]
-> ReadPrec ChurchBool
-> ReadPrec [ChurchBool]
-> Read ChurchBool
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChurchBool]
$creadListPrec :: ReadPrec [ChurchBool]
readPrec :: ReadPrec ChurchBool
$creadPrec :: ReadPrec ChurchBool
readList :: ReadS [ChurchBool]
$creadList :: ReadS [ChurchBool]
readsPrec :: Int -> ReadS ChurchBool
$creadsPrec :: Int -> ReadS ChurchBool
Read, Ord ChurchBool
Ord ChurchBool
-> ((ChurchBool, ChurchBool) -> [ChurchBool])
-> ((ChurchBool, ChurchBool) -> ChurchBool -> Int)
-> ((ChurchBool, ChurchBool) -> ChurchBool -> Int)
-> ((ChurchBool, ChurchBool) -> ChurchBool -> Bool)
-> ((ChurchBool, ChurchBool) -> Int)
-> ((ChurchBool, ChurchBool) -> Int)
-> Ix ChurchBool
(ChurchBool, ChurchBool) -> Int
(ChurchBool, ChurchBool) -> [ChurchBool]
(ChurchBool, ChurchBool) -> ChurchBool -> Bool
(ChurchBool, ChurchBool) -> ChurchBool -> Int
forall a.
Ord a
-> ((a, a) -> [a])
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Bool)
-> ((a, a) -> Int)
-> ((a, a) -> Int)
-> Ix a
unsafeRangeSize :: (ChurchBool, ChurchBool) -> Int
$cunsafeRangeSize :: (ChurchBool, ChurchBool) -> Int
rangeSize :: (ChurchBool, ChurchBool) -> Int
$crangeSize :: (ChurchBool, ChurchBool) -> Int
inRange :: (ChurchBool, ChurchBool) -> ChurchBool -> Bool
$cinRange :: (ChurchBool, ChurchBool) -> ChurchBool -> Bool
unsafeIndex :: (ChurchBool, ChurchBool) -> ChurchBool -> Int
$cunsafeIndex :: (ChurchBool, ChurchBool) -> ChurchBool -> Int
index :: (ChurchBool, ChurchBool) -> ChurchBool -> Int
$cindex :: (ChurchBool, ChurchBool) -> ChurchBool -> Int
range :: (ChurchBool, ChurchBool) -> [ChurchBool]
$crange :: (ChurchBool, ChurchBool) -> [ChurchBool]
Ix)

instance Applicable ChurchBool a (a -> a) where
  $* :: ChurchBool -> a -> a -> a
($*) (ChBool Bool
True) a
t a
_ = a
t
  ($*) (ChBool Bool
False) a
_ a
f = a
f

-- | Update the 'Bool' in a 'ChurchBool'.
mapChBool :: (Bool -> Bool) -> ChurchBool -> ChurchBool
mapChBool :: (Bool -> Bool) -> ChurchBool -> ChurchBool
mapChBool Bool -> Bool
f (ChBool Bool
x) = Bool -> ChurchBool
ChBool (Bool -> ChurchBool) -> Bool -> ChurchBool
forall a b. (a -> b) -> a -> b
$ Bool -> Bool
f Bool
x

-- | 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.
newtype ChurchNumeral a = ChNum {forall a. ChurchNumeral a -> a
unChNum :: a} deriving ((forall x. ChurchNumeral a -> Rep (ChurchNumeral a) x)
-> (forall x. Rep (ChurchNumeral a) x -> ChurchNumeral a)
-> Generic (ChurchNumeral a)
forall x. Rep (ChurchNumeral a) x -> ChurchNumeral a
forall x. ChurchNumeral a -> Rep (ChurchNumeral a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (ChurchNumeral a) x -> ChurchNumeral a
forall a x. ChurchNumeral a -> Rep (ChurchNumeral a) x
$cto :: forall a x. Rep (ChurchNumeral a) x -> ChurchNumeral a
$cfrom :: forall a x. ChurchNumeral a -> Rep (ChurchNumeral a) x
Generic, Typeable (ChurchNumeral a)
Typeable (ChurchNumeral a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ChurchNumeral a -> c (ChurchNumeral a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (ChurchNumeral a))
-> (ChurchNumeral a -> Constr)
-> (ChurchNumeral a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (ChurchNumeral a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (ChurchNumeral a)))
-> ((forall b. Data b => b -> b)
    -> ChurchNumeral a -> ChurchNumeral a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ChurchNumeral a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ChurchNumeral a -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> ChurchNumeral a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ChurchNumeral a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> ChurchNumeral a -> m (ChurchNumeral a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ChurchNumeral a -> m (ChurchNumeral a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ChurchNumeral a -> m (ChurchNumeral a))
-> Data (ChurchNumeral a)
ChurchNumeral a -> DataType
ChurchNumeral a -> Constr
(forall b. Data b => b -> b) -> ChurchNumeral a -> ChurchNumeral a
forall {a}. Data a => Typeable (ChurchNumeral a)
forall a. Data a => ChurchNumeral a -> DataType
forall a. Data a => ChurchNumeral a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> ChurchNumeral a -> ChurchNumeral a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> ChurchNumeral a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> ChurchNumeral a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchNumeral a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchNumeral a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> ChurchNumeral a -> m (ChurchNumeral a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> ChurchNumeral a -> m (ChurchNumeral a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ChurchNumeral a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChurchNumeral a -> c (ChurchNumeral a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ChurchNumeral a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ChurchNumeral a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> ChurchNumeral a -> u
forall u. (forall d. Data d => d -> u) -> ChurchNumeral a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchNumeral a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchNumeral a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChurchNumeral a -> m (ChurchNumeral a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChurchNumeral a -> m (ChurchNumeral a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ChurchNumeral a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChurchNumeral a -> c (ChurchNumeral a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ChurchNumeral a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ChurchNumeral a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChurchNumeral a -> m (ChurchNumeral a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> ChurchNumeral a -> m (ChurchNumeral a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChurchNumeral a -> m (ChurchNumeral a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> ChurchNumeral a -> m (ChurchNumeral a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChurchNumeral a -> m (ChurchNumeral a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> ChurchNumeral a -> m (ChurchNumeral a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ChurchNumeral a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> ChurchNumeral a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> ChurchNumeral a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> ChurchNumeral a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchNumeral a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchNumeral a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchNumeral a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchNumeral a -> r
gmapT :: (forall b. Data b => b -> b) -> ChurchNumeral a -> ChurchNumeral a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> ChurchNumeral a -> ChurchNumeral a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ChurchNumeral a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ChurchNumeral a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ChurchNumeral a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ChurchNumeral a))
dataTypeOf :: ChurchNumeral a -> DataType
$cdataTypeOf :: forall a. Data a => ChurchNumeral a -> DataType
toConstr :: ChurchNumeral a -> Constr
$ctoConstr :: forall a. Data a => ChurchNumeral a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ChurchNumeral a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ChurchNumeral a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChurchNumeral a -> c (ChurchNumeral a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChurchNumeral a -> c (ChurchNumeral a)
Data, ChurchNumeral a -> ChurchNumeral a -> Bool
(ChurchNumeral a -> ChurchNumeral a -> Bool)
-> (ChurchNumeral a -> ChurchNumeral a -> Bool)
-> Eq (ChurchNumeral a)
forall a. Eq a => ChurchNumeral a -> ChurchNumeral a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChurchNumeral a -> ChurchNumeral a -> Bool
$c/= :: forall a. Eq a => ChurchNumeral a -> ChurchNumeral a -> Bool
== :: ChurchNumeral a -> ChurchNumeral a -> Bool
$c== :: forall a. Eq a => ChurchNumeral a -> ChurchNumeral a -> Bool
Eq, Eq (ChurchNumeral a)
Eq (ChurchNumeral a)
-> (ChurchNumeral a -> ChurchNumeral a -> Ordering)
-> (ChurchNumeral a -> ChurchNumeral a -> Bool)
-> (ChurchNumeral a -> ChurchNumeral a -> Bool)
-> (ChurchNumeral a -> ChurchNumeral a -> Bool)
-> (ChurchNumeral a -> ChurchNumeral a -> Bool)
-> (ChurchNumeral a -> ChurchNumeral a -> ChurchNumeral a)
-> (ChurchNumeral a -> ChurchNumeral a -> ChurchNumeral a)
-> Ord (ChurchNumeral a)
ChurchNumeral a -> ChurchNumeral a -> Bool
ChurchNumeral a -> ChurchNumeral a -> Ordering
ChurchNumeral a -> ChurchNumeral a -> ChurchNumeral a
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall {a}. Ord a => Eq (ChurchNumeral a)
forall a. Ord a => ChurchNumeral a -> ChurchNumeral a -> Bool
forall a. Ord a => ChurchNumeral a -> ChurchNumeral a -> Ordering
forall a.
Ord a =>
ChurchNumeral a -> ChurchNumeral a -> ChurchNumeral a
min :: ChurchNumeral a -> ChurchNumeral a -> ChurchNumeral a
$cmin :: forall a.
Ord a =>
ChurchNumeral a -> ChurchNumeral a -> ChurchNumeral a
max :: ChurchNumeral a -> ChurchNumeral a -> ChurchNumeral a
$cmax :: forall a.
Ord a =>
ChurchNumeral a -> ChurchNumeral a -> ChurchNumeral a
>= :: ChurchNumeral a -> ChurchNumeral a -> Bool
$c>= :: forall a. Ord a => ChurchNumeral a -> ChurchNumeral a -> Bool
> :: ChurchNumeral a -> ChurchNumeral a -> Bool
$c> :: forall a. Ord a => ChurchNumeral a -> ChurchNumeral a -> Bool
<= :: ChurchNumeral a -> ChurchNumeral a -> Bool
$c<= :: forall a. Ord a => ChurchNumeral a -> ChurchNumeral a -> Bool
< :: ChurchNumeral a -> ChurchNumeral a -> Bool
$c< :: forall a. Ord a => ChurchNumeral a -> ChurchNumeral a -> Bool
compare :: ChurchNumeral a -> ChurchNumeral a -> Ordering
$ccompare :: forall a. Ord a => ChurchNumeral a -> ChurchNumeral a -> Ordering
Ord, Int -> ChurchNumeral a -> ShowS
[ChurchNumeral a] -> ShowS
ChurchNumeral a -> String
(Int -> ChurchNumeral a -> ShowS)
-> (ChurchNumeral a -> String)
-> ([ChurchNumeral a] -> ShowS)
-> Show (ChurchNumeral a)
forall a. Show a => Int -> ChurchNumeral a -> ShowS
forall a. Show a => [ChurchNumeral a] -> ShowS
forall a. Show a => ChurchNumeral a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChurchNumeral a] -> ShowS
$cshowList :: forall a. Show a => [ChurchNumeral a] -> ShowS
show :: ChurchNumeral a -> String
$cshow :: forall a. Show a => ChurchNumeral a -> String
showsPrec :: Int -> ChurchNumeral a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> ChurchNumeral a -> ShowS
Show, ReadPrec [ChurchNumeral a]
ReadPrec (ChurchNumeral a)
Int -> ReadS (ChurchNumeral a)
ReadS [ChurchNumeral a]
(Int -> ReadS (ChurchNumeral a))
-> ReadS [ChurchNumeral a]
-> ReadPrec (ChurchNumeral a)
-> ReadPrec [ChurchNumeral a]
-> Read (ChurchNumeral a)
forall a. Read a => ReadPrec [ChurchNumeral a]
forall a. Read a => ReadPrec (ChurchNumeral a)
forall a. Read a => Int -> ReadS (ChurchNumeral a)
forall a. Read a => ReadS [ChurchNumeral a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChurchNumeral a]
$creadListPrec :: forall a. Read a => ReadPrec [ChurchNumeral a]
readPrec :: ReadPrec (ChurchNumeral a)
$creadPrec :: forall a. Read a => ReadPrec (ChurchNumeral a)
readList :: ReadS [ChurchNumeral a]
$creadList :: forall a. Read a => ReadS [ChurchNumeral a]
readsPrec :: Int -> ReadS (ChurchNumeral a)
$creadsPrec :: forall a. Read a => Int -> ReadS (ChurchNumeral a)
Read, Ord (ChurchNumeral a)
Ord (ChurchNumeral a)
-> ((ChurchNumeral a, ChurchNumeral a) -> [ChurchNumeral a])
-> ((ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Int)
-> ((ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Int)
-> ((ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Bool)
-> ((ChurchNumeral a, ChurchNumeral a) -> Int)
-> ((ChurchNumeral a, ChurchNumeral a) -> Int)
-> Ix (ChurchNumeral a)
(ChurchNumeral a, ChurchNumeral a) -> Int
(ChurchNumeral a, ChurchNumeral a) -> [ChurchNumeral a]
(ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Bool
(ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Int
forall a.
Ord a
-> ((a, a) -> [a])
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Bool)
-> ((a, a) -> Int)
-> ((a, a) -> Int)
-> Ix a
forall {a}. Ix a => Ord (ChurchNumeral a)
forall a. Ix a => (ChurchNumeral a, ChurchNumeral a) -> Int
forall a.
Ix a =>
(ChurchNumeral a, ChurchNumeral a) -> [ChurchNumeral a]
forall a.
Ix a =>
(ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Bool
forall a.
Ix a =>
(ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Int
unsafeRangeSize :: (ChurchNumeral a, ChurchNumeral a) -> Int
$cunsafeRangeSize :: forall a. Ix a => (ChurchNumeral a, ChurchNumeral a) -> Int
rangeSize :: (ChurchNumeral a, ChurchNumeral a) -> Int
$crangeSize :: forall a. Ix a => (ChurchNumeral a, ChurchNumeral a) -> Int
inRange :: (ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Bool
$cinRange :: forall a.
Ix a =>
(ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Bool
unsafeIndex :: (ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Int
$cunsafeIndex :: forall a.
Ix a =>
(ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Int
index :: (ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Int
$cindex :: forall a.
Ix a =>
(ChurchNumeral a, ChurchNumeral a) -> ChurchNumeral a -> Int
range :: (ChurchNumeral a, ChurchNumeral a) -> [ChurchNumeral a]
$crange :: forall a.
Ix a =>
(ChurchNumeral a, ChurchNumeral a) -> [ChurchNumeral a]
Ix, (forall a b. (a -> b) -> ChurchNumeral a -> ChurchNumeral b)
-> (forall a b. a -> ChurchNumeral b -> ChurchNumeral a)
-> Functor ChurchNumeral
forall a b. a -> ChurchNumeral b -> ChurchNumeral a
forall a b. (a -> b) -> ChurchNumeral a -> ChurchNumeral b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> ChurchNumeral b -> ChurchNumeral a
$c<$ :: forall a b. a -> ChurchNumeral b -> ChurchNumeral a
fmap :: forall a b. (a -> b) -> ChurchNumeral a -> ChurchNumeral b
$cfmap :: forall a b. (a -> b) -> ChurchNumeral a -> ChurchNumeral b
Functor, (forall m. Monoid m => ChurchNumeral m -> m)
-> (forall m a. Monoid m => (a -> m) -> ChurchNumeral a -> m)
-> (forall m a. Monoid m => (a -> m) -> ChurchNumeral a -> m)
-> (forall a b. (a -> b -> b) -> b -> ChurchNumeral a -> b)
-> (forall a b. (a -> b -> b) -> b -> ChurchNumeral a -> b)
-> (forall b a. (b -> a -> b) -> b -> ChurchNumeral a -> b)
-> (forall b a. (b -> a -> b) -> b -> ChurchNumeral a -> b)
-> (forall a. (a -> a -> a) -> ChurchNumeral a -> a)
-> (forall a. (a -> a -> a) -> ChurchNumeral a -> a)
-> (forall a. ChurchNumeral a -> [a])
-> (forall a. ChurchNumeral a -> Bool)
-> (forall a. ChurchNumeral a -> Int)
-> (forall a. Eq a => a -> ChurchNumeral a -> Bool)
-> (forall a. Ord a => ChurchNumeral a -> a)
-> (forall a. Ord a => ChurchNumeral a -> a)
-> (forall a. Num a => ChurchNumeral a -> a)
-> (forall a. Num a => ChurchNumeral a -> a)
-> Foldable ChurchNumeral
forall a. Eq a => a -> ChurchNumeral a -> Bool
forall a. Num a => ChurchNumeral a -> a
forall a. Ord a => ChurchNumeral a -> a
forall m. Monoid m => ChurchNumeral m -> m
forall a. ChurchNumeral a -> Bool
forall a. ChurchNumeral a -> Int
forall a. ChurchNumeral a -> [a]
forall a. (a -> a -> a) -> ChurchNumeral a -> a
forall m a. Monoid m => (a -> m) -> ChurchNumeral a -> m
forall b a. (b -> a -> b) -> b -> ChurchNumeral a -> b
forall a b. (a -> b -> b) -> b -> ChurchNumeral a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => ChurchNumeral a -> a
$cproduct :: forall a. Num a => ChurchNumeral a -> a
sum :: forall a. Num a => ChurchNumeral a -> a
$csum :: forall a. Num a => ChurchNumeral a -> a
minimum :: forall a. Ord a => ChurchNumeral a -> a
$cminimum :: forall a. Ord a => ChurchNumeral a -> a
maximum :: forall a. Ord a => ChurchNumeral a -> a
$cmaximum :: forall a. Ord a => ChurchNumeral a -> a
elem :: forall a. Eq a => a -> ChurchNumeral a -> Bool
$celem :: forall a. Eq a => a -> ChurchNumeral a -> Bool
length :: forall a. ChurchNumeral a -> Int
$clength :: forall a. ChurchNumeral a -> Int
null :: forall a. ChurchNumeral a -> Bool
$cnull :: forall a. ChurchNumeral a -> Bool
toList :: forall a. ChurchNumeral a -> [a]
$ctoList :: forall a. ChurchNumeral a -> [a]
foldl1 :: forall a. (a -> a -> a) -> ChurchNumeral a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> ChurchNumeral a -> a
foldr1 :: forall a. (a -> a -> a) -> ChurchNumeral a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> ChurchNumeral a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> ChurchNumeral a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> ChurchNumeral a -> b
foldl :: forall b a. (b -> a -> b) -> b -> ChurchNumeral a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> ChurchNumeral a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> ChurchNumeral a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> ChurchNumeral a -> b
foldr :: forall a b. (a -> b -> b) -> b -> ChurchNumeral a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> ChurchNumeral a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> ChurchNumeral a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> ChurchNumeral a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> ChurchNumeral a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> ChurchNumeral a -> m
fold :: forall m. Monoid m => ChurchNumeral m -> m
$cfold :: forall m. Monoid m => ChurchNumeral m -> m
Foldable, Functor ChurchNumeral
Foldable ChurchNumeral
Functor ChurchNumeral
-> Foldable ChurchNumeral
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ChurchNumeral a -> f (ChurchNumeral b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    ChurchNumeral (f a) -> f (ChurchNumeral a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ChurchNumeral a -> m (ChurchNumeral b))
-> (forall (m :: * -> *) a.
    Monad m =>
    ChurchNumeral (m a) -> m (ChurchNumeral a))
-> Traversable ChurchNumeral
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
ChurchNumeral (m a) -> m (ChurchNumeral a)
forall (f :: * -> *) a.
Applicative f =>
ChurchNumeral (f a) -> f (ChurchNumeral a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ChurchNumeral a -> m (ChurchNumeral b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ChurchNumeral a -> f (ChurchNumeral b)
sequence :: forall (m :: * -> *) a.
Monad m =>
ChurchNumeral (m a) -> m (ChurchNumeral a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
ChurchNumeral (m a) -> m (ChurchNumeral a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ChurchNumeral a -> m (ChurchNumeral b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ChurchNumeral a -> m (ChurchNumeral b)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
ChurchNumeral (f a) -> f (ChurchNumeral a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
ChurchNumeral (f a) -> f (ChurchNumeral a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ChurchNumeral a -> f (ChurchNumeral b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ChurchNumeral a -> f (ChurchNumeral b)
Traversable)

instance Integral a => Applicable (ChurchNumeral a) (a -> a) (a -> a) where
  $* :: ChurchNumeral a -> (a -> a) -> a -> a
($*) (ChNum a
n) a -> a
f a
x = [a] -> a -> a
forall i a. Integral i => [a] -> i -> a
genericIndex ((a -> a) -> a -> [a]
forall a. (a -> a) -> a -> [a]
iterate a -> a
f a
x) a
n

-- | 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.
newtype ChurchTuple a b = ChTup {forall a b. ChurchTuple a b -> (a, b)
unChTup :: (a, b)} deriving ((forall x. ChurchTuple a b -> Rep (ChurchTuple a b) x)
-> (forall x. Rep (ChurchTuple a b) x -> ChurchTuple a b)
-> Generic (ChurchTuple a b)
forall x. Rep (ChurchTuple a b) x -> ChurchTuple a b
forall x. ChurchTuple a b -> Rep (ChurchTuple a b) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a b x. Rep (ChurchTuple a b) x -> ChurchTuple a b
forall a b x. ChurchTuple a b -> Rep (ChurchTuple a b) x
$cto :: forall a b x. Rep (ChurchTuple a b) x -> ChurchTuple a b
$cfrom :: forall a b x. ChurchTuple a b -> Rep (ChurchTuple a b) x
Generic, Typeable (ChurchTuple a b)
Typeable (ChurchTuple a b)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ChurchTuple a b -> c (ChurchTuple a b))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (ChurchTuple a b))
-> (ChurchTuple a b -> Constr)
-> (ChurchTuple a b -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (ChurchTuple a b)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (ChurchTuple a b)))
-> ((forall b. Data b => b -> b)
    -> ChurchTuple a b -> ChurchTuple a b)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ChurchTuple a b -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ChurchTuple a b -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> ChurchTuple a b -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ChurchTuple a b -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> ChurchTuple a b -> m (ChurchTuple a b))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ChurchTuple a b -> m (ChurchTuple a b))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ChurchTuple a b -> m (ChurchTuple a b))
-> Data (ChurchTuple a b)
ChurchTuple a b -> DataType
ChurchTuple a b -> Constr
(forall b. Data b => b -> b) -> ChurchTuple a b -> ChurchTuple a b
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> ChurchTuple a b -> u
forall u. (forall d. Data d => d -> u) -> ChurchTuple a b -> [u]
forall {a} {b}. (Data a, Data b) => Typeable (ChurchTuple a b)
forall a b. (Data a, Data b) => ChurchTuple a b -> DataType
forall a b. (Data a, Data b) => ChurchTuple a b -> Constr
forall a b.
(Data a, Data b) =>
(forall b. Data b => b -> b) -> ChurchTuple a b -> ChurchTuple a b
forall a b u.
(Data a, Data b) =>
Int -> (forall d. Data d => d -> u) -> ChurchTuple a b -> u
forall a b u.
(Data a, Data b) =>
(forall d. Data d => d -> u) -> ChurchTuple a b -> [u]
forall a b r r'.
(Data a, Data b) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchTuple a b -> r
forall a b r r'.
(Data a, Data b) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchTuple a b -> r
forall a b (m :: * -> *).
(Data a, Data b, Monad m) =>
(forall d. Data d => d -> m d)
-> ChurchTuple a b -> m (ChurchTuple a b)
forall a b (m :: * -> *).
(Data a, Data b, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> ChurchTuple a b -> m (ChurchTuple a b)
forall a b (c :: * -> *).
(Data a, Data b) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ChurchTuple a b)
forall a b (c :: * -> *).
(Data a, Data b) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChurchTuple a b -> c (ChurchTuple a b)
forall a b (t :: * -> *) (c :: * -> *).
(Data a, Data b, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ChurchTuple a b))
forall a b (t :: * -> * -> *) (c :: * -> *).
(Data a, Data b, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ChurchTuple a b))
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchTuple a b -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchTuple a b -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChurchTuple a b -> m (ChurchTuple a b)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChurchTuple a b -> m (ChurchTuple a b)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ChurchTuple a b)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChurchTuple a b -> c (ChurchTuple a b)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ChurchTuple a b))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ChurchTuple a b))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChurchTuple a b -> m (ChurchTuple a b)
$cgmapMo :: forall a b (m :: * -> *).
(Data a, Data b, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> ChurchTuple a b -> m (ChurchTuple a b)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChurchTuple a b -> m (ChurchTuple a b)
$cgmapMp :: forall a b (m :: * -> *).
(Data a, Data b, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> ChurchTuple a b -> m (ChurchTuple a b)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChurchTuple a b -> m (ChurchTuple a b)
$cgmapM :: forall a b (m :: * -> *).
(Data a, Data b, Monad m) =>
(forall d. Data d => d -> m d)
-> ChurchTuple a b -> m (ChurchTuple a b)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ChurchTuple a b -> u
$cgmapQi :: forall a b u.
(Data a, Data b) =>
Int -> (forall d. Data d => d -> u) -> ChurchTuple a b -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> ChurchTuple a b -> [u]
$cgmapQ :: forall a b u.
(Data a, Data b) =>
(forall d. Data d => d -> u) -> ChurchTuple a b -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchTuple a b -> r
$cgmapQr :: forall a b r r'.
(Data a, Data b) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchTuple a b -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchTuple a b -> r
$cgmapQl :: forall a b r r'.
(Data a, Data b) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChurchTuple a b -> r
gmapT :: (forall b. Data b => b -> b) -> ChurchTuple a b -> ChurchTuple a b
$cgmapT :: forall a b.
(Data a, Data b) =>
(forall b. Data b => b -> b) -> ChurchTuple a b -> ChurchTuple a b
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ChurchTuple a b))
$cdataCast2 :: forall a b (t :: * -> * -> *) (c :: * -> *).
(Data a, Data b, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ChurchTuple a b))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ChurchTuple a b))
$cdataCast1 :: forall a b (t :: * -> *) (c :: * -> *).
(Data a, Data b, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ChurchTuple a b))
dataTypeOf :: ChurchTuple a b -> DataType
$cdataTypeOf :: forall a b. (Data a, Data b) => ChurchTuple a b -> DataType
toConstr :: ChurchTuple a b -> Constr
$ctoConstr :: forall a b. (Data a, Data b) => ChurchTuple a b -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ChurchTuple a b)
$cgunfold :: forall a b (c :: * -> *).
(Data a, Data b) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ChurchTuple a b)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChurchTuple a b -> c (ChurchTuple a b)
$cgfoldl :: forall a b (c :: * -> *).
(Data a, Data b) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChurchTuple a b -> c (ChurchTuple a b)
Data, ChurchTuple a b -> ChurchTuple a b -> Bool
(ChurchTuple a b -> ChurchTuple a b -> Bool)
-> (ChurchTuple a b -> ChurchTuple a b -> Bool)
-> Eq (ChurchTuple a b)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall a b.
(Eq a, Eq b) =>
ChurchTuple a b -> ChurchTuple a b -> Bool
/= :: ChurchTuple a b -> ChurchTuple a b -> Bool
$c/= :: forall a b.
(Eq a, Eq b) =>
ChurchTuple a b -> ChurchTuple a b -> Bool
== :: ChurchTuple a b -> ChurchTuple a b -> Bool
$c== :: forall a b.
(Eq a, Eq b) =>
ChurchTuple a b -> ChurchTuple a b -> Bool
Eq, Eq (ChurchTuple a b)
Eq (ChurchTuple a b)
-> (ChurchTuple a b -> ChurchTuple a b -> Ordering)
-> (ChurchTuple a b -> ChurchTuple a b -> Bool)
-> (ChurchTuple a b -> ChurchTuple a b -> Bool)
-> (ChurchTuple a b -> ChurchTuple a b -> Bool)
-> (ChurchTuple a b -> ChurchTuple a b -> Bool)
-> (ChurchTuple a b -> ChurchTuple a b -> ChurchTuple a b)
-> (ChurchTuple a b -> ChurchTuple a b -> ChurchTuple a b)
-> Ord (ChurchTuple a b)
ChurchTuple a b -> ChurchTuple a b -> Bool
ChurchTuple a b -> ChurchTuple a b -> Ordering
ChurchTuple a b -> ChurchTuple a b -> ChurchTuple a b
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall {a} {b}. (Ord a, Ord b) => Eq (ChurchTuple a b)
forall a b.
(Ord a, Ord b) =>
ChurchTuple a b -> ChurchTuple a b -> Bool
forall a b.
(Ord a, Ord b) =>
ChurchTuple a b -> ChurchTuple a b -> Ordering
forall a b.
(Ord a, Ord b) =>
ChurchTuple a b -> ChurchTuple a b -> ChurchTuple a b
min :: ChurchTuple a b -> ChurchTuple a b -> ChurchTuple a b
$cmin :: forall a b.
(Ord a, Ord b) =>
ChurchTuple a b -> ChurchTuple a b -> ChurchTuple a b
max :: ChurchTuple a b -> ChurchTuple a b -> ChurchTuple a b
$cmax :: forall a b.
(Ord a, Ord b) =>
ChurchTuple a b -> ChurchTuple a b -> ChurchTuple a b
>= :: ChurchTuple a b -> ChurchTuple a b -> Bool
$c>= :: forall a b.
(Ord a, Ord b) =>
ChurchTuple a b -> ChurchTuple a b -> Bool
> :: ChurchTuple a b -> ChurchTuple a b -> Bool
$c> :: forall a b.
(Ord a, Ord b) =>
ChurchTuple a b -> ChurchTuple a b -> Bool
<= :: ChurchTuple a b -> ChurchTuple a b -> Bool
$c<= :: forall a b.
(Ord a, Ord b) =>
ChurchTuple a b -> ChurchTuple a b -> Bool
< :: ChurchTuple a b -> ChurchTuple a b -> Bool
$c< :: forall a b.
(Ord a, Ord b) =>
ChurchTuple a b -> ChurchTuple a b -> Bool
compare :: ChurchTuple a b -> ChurchTuple a b -> Ordering
$ccompare :: forall a b.
(Ord a, Ord b) =>
ChurchTuple a b -> ChurchTuple a b -> Ordering
Ord, Int -> ChurchTuple a b -> ShowS
[ChurchTuple a b] -> ShowS
ChurchTuple a b -> String
(Int -> ChurchTuple a b -> ShowS)
-> (ChurchTuple a b -> String)
-> ([ChurchTuple a b] -> ShowS)
-> Show (ChurchTuple a b)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall a b. (Show a, Show b) => Int -> ChurchTuple a b -> ShowS
forall a b. (Show a, Show b) => [ChurchTuple a b] -> ShowS
forall a b. (Show a, Show b) => ChurchTuple a b -> String
showList :: [ChurchTuple a b] -> ShowS
$cshowList :: forall a b. (Show a, Show b) => [ChurchTuple a b] -> ShowS
show :: ChurchTuple a b -> String
$cshow :: forall a b. (Show a, Show b) => ChurchTuple a b -> String
showsPrec :: Int -> ChurchTuple a b -> ShowS
$cshowsPrec :: forall a b. (Show a, Show b) => Int -> ChurchTuple a b -> ShowS
Show, ReadPrec [ChurchTuple a b]
ReadPrec (ChurchTuple a b)
Int -> ReadS (ChurchTuple a b)
ReadS [ChurchTuple a b]
(Int -> ReadS (ChurchTuple a b))
-> ReadS [ChurchTuple a b]
-> ReadPrec (ChurchTuple a b)
-> ReadPrec [ChurchTuple a b]
-> Read (ChurchTuple a b)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall a b. (Read a, Read b) => ReadPrec [ChurchTuple a b]
forall a b. (Read a, Read b) => ReadPrec (ChurchTuple a b)
forall a b. (Read a, Read b) => Int -> ReadS (ChurchTuple a b)
forall a b. (Read a, Read b) => ReadS [ChurchTuple a b]
readListPrec :: ReadPrec [ChurchTuple a b]
$creadListPrec :: forall a b. (Read a, Read b) => ReadPrec [ChurchTuple a b]
readPrec :: ReadPrec (ChurchTuple a b)
$creadPrec :: forall a b. (Read a, Read b) => ReadPrec (ChurchTuple a b)
readList :: ReadS [ChurchTuple a b]
$creadList :: forall a b. (Read a, Read b) => ReadS [ChurchTuple a b]
readsPrec :: Int -> ReadS (ChurchTuple a b)
$creadsPrec :: forall a b. (Read a, Read b) => Int -> ReadS (ChurchTuple a b)
Read, Ord (ChurchTuple a b)
Ord (ChurchTuple a b)
-> ((ChurchTuple a b, ChurchTuple a b) -> [ChurchTuple a b])
-> ((ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Int)
-> ((ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Int)
-> ((ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Bool)
-> ((ChurchTuple a b, ChurchTuple a b) -> Int)
-> ((ChurchTuple a b, ChurchTuple a b) -> Int)
-> Ix (ChurchTuple a b)
(ChurchTuple a b, ChurchTuple a b) -> Int
(ChurchTuple a b, ChurchTuple a b) -> [ChurchTuple a b]
(ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Bool
(ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Int
forall a.
Ord a
-> ((a, a) -> [a])
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Bool)
-> ((a, a) -> Int)
-> ((a, a) -> Int)
-> Ix a
forall {a} {b}. (Ix a, Ix b) => Ord (ChurchTuple a b)
forall a b.
(Ix a, Ix b) =>
(ChurchTuple a b, ChurchTuple a b) -> Int
forall a b.
(Ix a, Ix b) =>
(ChurchTuple a b, ChurchTuple a b) -> [ChurchTuple a b]
forall a b.
(Ix a, Ix b) =>
(ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Bool
forall a b.
(Ix a, Ix b) =>
(ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Int
unsafeRangeSize :: (ChurchTuple a b, ChurchTuple a b) -> Int
$cunsafeRangeSize :: forall a b.
(Ix a, Ix b) =>
(ChurchTuple a b, ChurchTuple a b) -> Int
rangeSize :: (ChurchTuple a b, ChurchTuple a b) -> Int
$crangeSize :: forall a b.
(Ix a, Ix b) =>
(ChurchTuple a b, ChurchTuple a b) -> Int
inRange :: (ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Bool
$cinRange :: forall a b.
(Ix a, Ix b) =>
(ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Bool
unsafeIndex :: (ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Int
$cunsafeIndex :: forall a b.
(Ix a, Ix b) =>
(ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Int
index :: (ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Int
$cindex :: forall a b.
(Ix a, Ix b) =>
(ChurchTuple a b, ChurchTuple a b) -> ChurchTuple a b -> Int
range :: (ChurchTuple a b, ChurchTuple a b) -> [ChurchTuple a b]
$crange :: forall a b.
(Ix a, Ix b) =>
(ChurchTuple a b, ChurchTuple a b) -> [ChurchTuple a b]
Ix, (forall a b. (a -> b) -> ChurchTuple a a -> ChurchTuple a b)
-> (forall a b. a -> ChurchTuple a b -> ChurchTuple a a)
-> Functor (ChurchTuple a)
forall a b. a -> ChurchTuple a b -> ChurchTuple a a
forall a b. (a -> b) -> ChurchTuple a a -> ChurchTuple a b
forall a a b. a -> ChurchTuple a b -> ChurchTuple a a
forall a a b. (a -> b) -> ChurchTuple a a -> ChurchTuple a b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> ChurchTuple a b -> ChurchTuple a a
$c<$ :: forall a a b. a -> ChurchTuple a b -> ChurchTuple a a
fmap :: forall a b. (a -> b) -> ChurchTuple a a -> ChurchTuple a b
$cfmap :: forall a a b. (a -> b) -> ChurchTuple a a -> ChurchTuple a b
Functor, (forall m. Monoid m => ChurchTuple a m -> m)
-> (forall m a. Monoid m => (a -> m) -> ChurchTuple a a -> m)
-> (forall m a. Monoid m => (a -> m) -> ChurchTuple a a -> m)
-> (forall a b. (a -> b -> b) -> b -> ChurchTuple a a -> b)
-> (forall a b. (a -> b -> b) -> b -> ChurchTuple a a -> b)
-> (forall b a. (b -> a -> b) -> b -> ChurchTuple a a -> b)
-> (forall b a. (b -> a -> b) -> b -> ChurchTuple a a -> b)
-> (forall a. (a -> a -> a) -> ChurchTuple a a -> a)
-> (forall a. (a -> a -> a) -> ChurchTuple a a -> a)
-> (forall a. ChurchTuple a a -> [a])
-> (forall a. ChurchTuple a a -> Bool)
-> (forall a. ChurchTuple a a -> Int)
-> (forall a. Eq a => a -> ChurchTuple a a -> Bool)
-> (forall a. Ord a => ChurchTuple a a -> a)
-> (forall a. Ord a => ChurchTuple a a -> a)
-> (forall a. Num a => ChurchTuple a a -> a)
-> (forall a. Num a => ChurchTuple a a -> a)
-> Foldable (ChurchTuple a)
forall a. Eq a => a -> ChurchTuple a a -> Bool
forall a. Num a => ChurchTuple a a -> a
forall a. Ord a => ChurchTuple a a -> a
forall m. Monoid m => ChurchTuple a m -> m
forall a. ChurchTuple a a -> Bool
forall a. ChurchTuple a a -> Int
forall a. ChurchTuple a a -> [a]
forall a. (a -> a -> a) -> ChurchTuple a a -> a
forall a a. Eq a => a -> ChurchTuple a a -> Bool
forall a a. Num a => ChurchTuple a a -> a
forall a a. Ord a => ChurchTuple a a -> a
forall m a. Monoid m => (a -> m) -> ChurchTuple a a -> m
forall a m. Monoid m => ChurchTuple a m -> m
forall a a. ChurchTuple a a -> Bool
forall a a. ChurchTuple a a -> Int
forall a a. ChurchTuple a a -> [a]
forall b a. (b -> a -> b) -> b -> ChurchTuple a a -> b
forall a b. (a -> b -> b) -> b -> ChurchTuple a a -> b
forall a a. (a -> a -> a) -> ChurchTuple a a -> a
forall a m a. Monoid m => (a -> m) -> ChurchTuple a a -> m
forall a b a. (b -> a -> b) -> b -> ChurchTuple a a -> b
forall a a b. (a -> b -> b) -> b -> ChurchTuple a a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => ChurchTuple a a -> a
$cproduct :: forall a a. Num a => ChurchTuple a a -> a
sum :: forall a. Num a => ChurchTuple a a -> a
$csum :: forall a a. Num a => ChurchTuple a a -> a
minimum :: forall a. Ord a => ChurchTuple a a -> a
$cminimum :: forall a a. Ord a => ChurchTuple a a -> a
maximum :: forall a. Ord a => ChurchTuple a a -> a
$cmaximum :: forall a a. Ord a => ChurchTuple a a -> a
elem :: forall a. Eq a => a -> ChurchTuple a a -> Bool
$celem :: forall a a. Eq a => a -> ChurchTuple a a -> Bool
length :: forall a. ChurchTuple a a -> Int
$clength :: forall a a. ChurchTuple a a -> Int
null :: forall a. ChurchTuple a a -> Bool
$cnull :: forall a a. ChurchTuple a a -> Bool
toList :: forall a. ChurchTuple a a -> [a]
$ctoList :: forall a a. ChurchTuple a a -> [a]
foldl1 :: forall a. (a -> a -> a) -> ChurchTuple a a -> a
$cfoldl1 :: forall a a. (a -> a -> a) -> ChurchTuple a a -> a
foldr1 :: forall a. (a -> a -> a) -> ChurchTuple a a -> a
$cfoldr1 :: forall a a. (a -> a -> a) -> ChurchTuple a a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> ChurchTuple a a -> b
$cfoldl' :: forall a b a. (b -> a -> b) -> b -> ChurchTuple a a -> b
foldl :: forall b a. (b -> a -> b) -> b -> ChurchTuple a a -> b
$cfoldl :: forall a b a. (b -> a -> b) -> b -> ChurchTuple a a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> ChurchTuple a a -> b
$cfoldr' :: forall a a b. (a -> b -> b) -> b -> ChurchTuple a a -> b
foldr :: forall a b. (a -> b -> b) -> b -> ChurchTuple a a -> b
$cfoldr :: forall a a b. (a -> b -> b) -> b -> ChurchTuple a a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> ChurchTuple a a -> m
$cfoldMap' :: forall a m a. Monoid m => (a -> m) -> ChurchTuple a a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> ChurchTuple a a -> m
$cfoldMap :: forall a m a. Monoid m => (a -> m) -> ChurchTuple a a -> m
fold :: forall m. Monoid m => ChurchTuple a m -> m
$cfold :: forall a m. Monoid m => ChurchTuple a m -> m
Foldable, Functor (ChurchTuple a)
Foldable (ChurchTuple a)
Functor (ChurchTuple a)
-> Foldable (ChurchTuple a)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ChurchTuple a a -> f (ChurchTuple a b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    ChurchTuple a (f a) -> f (ChurchTuple a a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ChurchTuple a a -> m (ChurchTuple a b))
-> (forall (m :: * -> *) a.
    Monad m =>
    ChurchTuple a (m a) -> m (ChurchTuple a a))
-> Traversable (ChurchTuple a)
forall a. Functor (ChurchTuple a)
forall a. Foldable (ChurchTuple a)
forall a (m :: * -> *) a.
Monad m =>
ChurchTuple a (m a) -> m (ChurchTuple a a)
forall a (f :: * -> *) a.
Applicative f =>
ChurchTuple a (f a) -> f (ChurchTuple a a)
forall a (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ChurchTuple a a -> m (ChurchTuple a b)
forall a (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ChurchTuple a a -> f (ChurchTuple a b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
ChurchTuple a (m a) -> m (ChurchTuple a a)
forall (f :: * -> *) a.
Applicative f =>
ChurchTuple a (f a) -> f (ChurchTuple a a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ChurchTuple a a -> m (ChurchTuple a b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ChurchTuple a a -> f (ChurchTuple a b)
sequence :: forall (m :: * -> *) a.
Monad m =>
ChurchTuple a (m a) -> m (ChurchTuple a a)
$csequence :: forall a (m :: * -> *) a.
Monad m =>
ChurchTuple a (m a) -> m (ChurchTuple a a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ChurchTuple a a -> m (ChurchTuple a b)
$cmapM :: forall a (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ChurchTuple a a -> m (ChurchTuple a b)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
ChurchTuple a (f a) -> f (ChurchTuple a a)
$csequenceA :: forall a (f :: * -> *) a.
Applicative f =>
ChurchTuple a (f a) -> f (ChurchTuple a a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ChurchTuple a a -> f (ChurchTuple a b)
$ctraverse :: forall a (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ChurchTuple a a -> f (ChurchTuple a b)
Traversable, (forall a b c d.
 (a -> b) -> (c -> d) -> ChurchTuple a c -> ChurchTuple b d)
-> (forall a b c. (a -> b) -> ChurchTuple a c -> ChurchTuple b c)
-> (forall b c a. (b -> c) -> ChurchTuple a b -> ChurchTuple a c)
-> Bifunctor ChurchTuple
forall a b c. (a -> b) -> ChurchTuple a c -> ChurchTuple b c
forall b c a. (b -> c) -> ChurchTuple a b -> ChurchTuple a c
forall a b c d.
(a -> b) -> (c -> d) -> ChurchTuple a c -> ChurchTuple b d
forall (p :: * -> * -> *).
(forall a b c d. (a -> b) -> (c -> d) -> p a c -> p b d)
-> (forall a b c. (a -> b) -> p a c -> p b c)
-> (forall b c a. (b -> c) -> p a b -> p a c)
-> Bifunctor p
second :: forall b c a. (b -> c) -> ChurchTuple a b -> ChurchTuple a c
$csecond :: forall b c a. (b -> c) -> ChurchTuple a b -> ChurchTuple a c
first :: forall a b c. (a -> b) -> ChurchTuple a c -> ChurchTuple b c
$cfirst :: forall a b c. (a -> b) -> ChurchTuple a c -> ChurchTuple b c
bimap :: forall a b c d.
(a -> b) -> (c -> d) -> ChurchTuple a c -> ChurchTuple b d
$cbimap :: forall a b c d.
(a -> b) -> (c -> d) -> ChurchTuple a c -> ChurchTuple b d
Bifunctor)

instance Applicable (ChurchTuple a b) (a -> b -> c) c where
  ChTup (a
x, b
y) $* :: ChurchTuple a b -> (a -> b -> c) -> c
$* a -> b -> c
f = a -> b -> c
f a
x b
y