{-# LANGUAGE CPP, DeriveDataTypeable, DeriveTraversable, DeriveFoldable,
DeriveGeneric #-}
module Data.Functor.Of (Of(..)) where
import Data.Monoid (Monoid (..))
import Data.Semigroup (Semigroup (..))
import Control.Applicative
import Data.Traversable (Traversable)
import Data.Foldable (Foldable)
import Data.Bifunctor
import Data.Data
#if MIN_VERSION_base(4,9,0)
import Data.Functor.Classes
import Data.Foldable (Foldable)
import Data.Traversable (Traversable)
#endif
#if MIN_VERSION_base(4,10,0)
import Data.Bifoldable (Bifoldable, bifoldMap)
import Data.Bitraversable (Bitraversable, bitraverse)
#endif
import GHC.Generics (Generic, Generic1)
data Of a b = !a :> b
deriving (Typeable (Of a b)
DataType
Constr
Typeable (Of a b)
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Of a b -> c (Of a b))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Of a b))
-> (Of a b -> Constr)
-> (Of a b -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Of a b)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Of a b)))
-> ((forall b. Data b => b -> b) -> Of a b -> Of a b)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Of a b -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Of a b -> r)
-> (forall u. (forall d. Data d => d -> u) -> Of a b -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Of a b -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Of a b -> m (Of a b))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Of a b -> m (Of a b))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Of a b -> m (Of a b))
-> Data (Of a b)
Of a b -> DataType
Of a b -> Constr
(forall b. Data b => b -> b) -> Of a b -> Of a b
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Of a b -> c (Of a b)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Of a b)
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Of 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) -> Of a b -> u
forall u. (forall d. Data d => d -> u) -> Of a b -> [u]
forall a b. (Data a, Data b) => Typeable (Of a b)
forall a b. (Data a, Data b) => Of a b -> DataType
forall a b. (Data a, Data b) => Of a b -> Constr
forall a b.
(Data a, Data b) =>
(forall b. Data b => b -> b) -> Of a b -> Of a b
forall a b u.
(Data a, Data b) =>
Int -> (forall d. Data d => d -> u) -> Of a b -> u
forall a b u.
(Data a, Data b) =>
(forall d. Data d => d -> u) -> Of a b -> [u]
forall a b r r'.
(Data a, Data b) =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Of a b -> r
forall a b r r'.
(Data a, Data b) =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Of a b -> r
forall a b (m :: * -> *).
(Data a, Data b, Monad m) =>
(forall d. Data d => d -> m d) -> Of a b -> m (Of a b)
forall a b (m :: * -> *).
(Data a, Data b, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Of a b -> m (Of 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 (Of 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) -> Of a b -> c (Of a b)
forall a b (t :: * -> *) (c :: * -> *).
(Data a, Data b, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Of 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 (Of a b))
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Of a b -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Of a b -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Of a b -> m (Of a b)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Of a b -> m (Of a b)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Of a b)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Of a b -> c (Of a b)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Of a b))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Of a b))
$c:> :: Constr
$tOf :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Of a b -> m (Of a b)
$cgmapMo :: forall a b (m :: * -> *).
(Data a, Data b, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Of a b -> m (Of a b)
gmapMp :: (forall d. Data d => d -> m d) -> Of a b -> m (Of a b)
$cgmapMp :: forall a b (m :: * -> *).
(Data a, Data b, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Of a b -> m (Of a b)
gmapM :: (forall d. Data d => d -> m d) -> Of a b -> m (Of a b)
$cgmapM :: forall a b (m :: * -> *).
(Data a, Data b, Monad m) =>
(forall d. Data d => d -> m d) -> Of a b -> m (Of a b)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Of a b -> u
$cgmapQi :: forall a b u.
(Data a, Data b) =>
Int -> (forall d. Data d => d -> u) -> Of a b -> u
gmapQ :: (forall d. Data d => d -> u) -> Of a b -> [u]
$cgmapQ :: forall a b u.
(Data a, Data b) =>
(forall d. Data d => d -> u) -> Of a b -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Of a b -> r
$cgmapQr :: forall a b r r'.
(Data a, Data b) =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Of a b -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Of a b -> r
$cgmapQl :: forall a b r r'.
(Data a, Data b) =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Of a b -> r
gmapT :: (forall b. Data b => b -> b) -> Of a b -> Of a b
$cgmapT :: forall a b.
(Data a, Data b) =>
(forall b. Data b => b -> b) -> Of a b -> Of a b
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Of 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 (Of a b))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Of a b))
$cdataCast1 :: forall a b (t :: * -> *) (c :: * -> *).
(Data a, Data b, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Of a b))
dataTypeOf :: Of a b -> DataType
$cdataTypeOf :: forall a b. (Data a, Data b) => Of a b -> DataType
toConstr :: Of a b -> Constr
$ctoConstr :: forall a b. (Data a, Data b) => Of a b -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Of 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 (Of a b)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Of a b -> c (Of 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) -> Of a b -> c (Of a b)
$cp1Data :: forall a b. (Data a, Data b) => Typeable (Of a b)
Data, Of a b -> Of a b -> Bool
(Of a b -> Of a b -> Bool)
-> (Of a b -> Of a b -> Bool) -> Eq (Of a b)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall a b. (Eq a, Eq b) => Of a b -> Of a b -> Bool
/= :: Of a b -> Of a b -> Bool
$c/= :: forall a b. (Eq a, Eq b) => Of a b -> Of a b -> Bool
== :: Of a b -> Of a b -> Bool
$c== :: forall a b. (Eq a, Eq b) => Of a b -> Of a b -> Bool
Eq, Of a a -> Bool
(a -> m) -> Of a a -> m
(a -> b -> b) -> b -> Of a a -> b
(forall m. Monoid m => Of a m -> m)
-> (forall m a. Monoid m => (a -> m) -> Of a a -> m)
-> (forall m a. Monoid m => (a -> m) -> Of a a -> m)
-> (forall a b. (a -> b -> b) -> b -> Of a a -> b)
-> (forall a b. (a -> b -> b) -> b -> Of a a -> b)
-> (forall b a. (b -> a -> b) -> b -> Of a a -> b)
-> (forall b a. (b -> a -> b) -> b -> Of a a -> b)
-> (forall a. (a -> a -> a) -> Of a a -> a)
-> (forall a. (a -> a -> a) -> Of a a -> a)
-> (forall a. Of a a -> [a])
-> (forall a. Of a a -> Bool)
-> (forall a. Of a a -> Int)
-> (forall a. Eq a => a -> Of a a -> Bool)
-> (forall a. Ord a => Of a a -> a)
-> (forall a. Ord a => Of a a -> a)
-> (forall a. Num a => Of a a -> a)
-> (forall a. Num a => Of a a -> a)
-> Foldable (Of a)
forall a. Eq a => a -> Of a a -> Bool
forall a. Num a => Of a a -> a
forall a. Ord a => Of a a -> a
forall m. Monoid m => Of a m -> m
forall a. Of a a -> Bool
forall a. Of a a -> Int
forall a. Of a a -> [a]
forall a. (a -> a -> a) -> Of a a -> a
forall a a. Eq a => a -> Of a a -> Bool
forall a a. Num a => Of a a -> a
forall a a. Ord a => Of a a -> a
forall m a. Monoid m => (a -> m) -> Of a a -> m
forall a m. Monoid m => Of a m -> m
forall a a. Of a a -> Bool
forall a a. Of a a -> Int
forall a a. Of a a -> [a]
forall b a. (b -> a -> b) -> b -> Of a a -> b
forall a b. (a -> b -> b) -> b -> Of a a -> b
forall a a. (a -> a -> a) -> Of a a -> a
forall a m a. Monoid m => (a -> m) -> Of a a -> m
forall a b a. (b -> a -> b) -> b -> Of a a -> b
forall a a b. (a -> b -> b) -> b -> Of 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 :: Of a a -> a
$cproduct :: forall a a. Num a => Of a a -> a
sum :: Of a a -> a
$csum :: forall a a. Num a => Of a a -> a
minimum :: Of a a -> a
$cminimum :: forall a a. Ord a => Of a a -> a
maximum :: Of a a -> a
$cmaximum :: forall a a. Ord a => Of a a -> a
elem :: a -> Of a a -> Bool
$celem :: forall a a. Eq a => a -> Of a a -> Bool
length :: Of a a -> Int
$clength :: forall a a. Of a a -> Int
null :: Of a a -> Bool
$cnull :: forall a a. Of a a -> Bool
toList :: Of a a -> [a]
$ctoList :: forall a a. Of a a -> [a]
foldl1 :: (a -> a -> a) -> Of a a -> a
$cfoldl1 :: forall a a. (a -> a -> a) -> Of a a -> a
foldr1 :: (a -> a -> a) -> Of a a -> a
$cfoldr1 :: forall a a. (a -> a -> a) -> Of a a -> a
foldl' :: (b -> a -> b) -> b -> Of a a -> b
$cfoldl' :: forall a b a. (b -> a -> b) -> b -> Of a a -> b
foldl :: (b -> a -> b) -> b -> Of a a -> b
$cfoldl :: forall a b a. (b -> a -> b) -> b -> Of a a -> b
foldr' :: (a -> b -> b) -> b -> Of a a -> b
$cfoldr' :: forall a a b. (a -> b -> b) -> b -> Of a a -> b
foldr :: (a -> b -> b) -> b -> Of a a -> b
$cfoldr :: forall a a b. (a -> b -> b) -> b -> Of a a -> b
foldMap' :: (a -> m) -> Of a a -> m
$cfoldMap' :: forall a m a. Monoid m => (a -> m) -> Of a a -> m
foldMap :: (a -> m) -> Of a a -> m
$cfoldMap :: forall a m a. Monoid m => (a -> m) -> Of a a -> m
fold :: Of a m -> m
$cfold :: forall a m. Monoid m => Of a m -> m
Foldable, Eq (Of a b)
Eq (Of a b)
-> (Of a b -> Of a b -> Ordering)
-> (Of a b -> Of a b -> Bool)
-> (Of a b -> Of a b -> Bool)
-> (Of a b -> Of a b -> Bool)
-> (Of a b -> Of a b -> Bool)
-> (Of a b -> Of a b -> Of a b)
-> (Of a b -> Of a b -> Of a b)
-> Ord (Of a b)
Of a b -> Of a b -> Bool
Of a b -> Of a b -> Ordering
Of a b -> Of a b -> Of 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 (Of a b)
forall a b. (Ord a, Ord b) => Of a b -> Of a b -> Bool
forall a b. (Ord a, Ord b) => Of a b -> Of a b -> Ordering
forall a b. (Ord a, Ord b) => Of a b -> Of a b -> Of a b
min :: Of a b -> Of a b -> Of a b
$cmin :: forall a b. (Ord a, Ord b) => Of a b -> Of a b -> Of a b
max :: Of a b -> Of a b -> Of a b
$cmax :: forall a b. (Ord a, Ord b) => Of a b -> Of a b -> Of a b
>= :: Of a b -> Of a b -> Bool
$c>= :: forall a b. (Ord a, Ord b) => Of a b -> Of a b -> Bool
> :: Of a b -> Of a b -> Bool
$c> :: forall a b. (Ord a, Ord b) => Of a b -> Of a b -> Bool
<= :: Of a b -> Of a b -> Bool
$c<= :: forall a b. (Ord a, Ord b) => Of a b -> Of a b -> Bool
< :: Of a b -> Of a b -> Bool
$c< :: forall a b. (Ord a, Ord b) => Of a b -> Of a b -> Bool
compare :: Of a b -> Of a b -> Ordering
$ccompare :: forall a b. (Ord a, Ord b) => Of a b -> Of a b -> Ordering
$cp1Ord :: forall a b. (Ord a, Ord b) => Eq (Of a b)
Ord,
ReadPrec [Of a b]
ReadPrec (Of a b)
Int -> ReadS (Of a b)
ReadS [Of a b]
(Int -> ReadS (Of a b))
-> ReadS [Of a b]
-> ReadPrec (Of a b)
-> ReadPrec [Of a b]
-> Read (Of a b)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall a b. (Read a, Read b) => ReadPrec [Of a b]
forall a b. (Read a, Read b) => ReadPrec (Of a b)
forall a b. (Read a, Read b) => Int -> ReadS (Of a b)
forall a b. (Read a, Read b) => ReadS [Of a b]
readListPrec :: ReadPrec [Of a b]
$creadListPrec :: forall a b. (Read a, Read b) => ReadPrec [Of a b]
readPrec :: ReadPrec (Of a b)
$creadPrec :: forall a b. (Read a, Read b) => ReadPrec (Of a b)
readList :: ReadS [Of a b]
$creadList :: forall a b. (Read a, Read b) => ReadS [Of a b]
readsPrec :: Int -> ReadS (Of a b)
$creadsPrec :: forall a b. (Read a, Read b) => Int -> ReadS (Of a b)
Read, Int -> Of a b -> ShowS
[Of a b] -> ShowS
Of a b -> String
(Int -> Of a b -> ShowS)
-> (Of a b -> String) -> ([Of a b] -> ShowS) -> Show (Of a b)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall a b. (Show a, Show b) => Int -> Of a b -> ShowS
forall a b. (Show a, Show b) => [Of a b] -> ShowS
forall a b. (Show a, Show b) => Of a b -> String
showList :: [Of a b] -> ShowS
$cshowList :: forall a b. (Show a, Show b) => [Of a b] -> ShowS
show :: Of a b -> String
$cshow :: forall a b. (Show a, Show b) => Of a b -> String
showsPrec :: Int -> Of a b -> ShowS
$cshowsPrec :: forall a b. (Show a, Show b) => Int -> Of a b -> ShowS
Show, Functor (Of a)
Foldable (Of a)
Functor (Of a)
-> Foldable (Of a)
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Of a a -> f (Of a b))
-> (forall (f :: * -> *) a.
Applicative f =>
Of a (f a) -> f (Of a a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Of a a -> m (Of a b))
-> (forall (m :: * -> *) a. Monad m => Of a (m a) -> m (Of a a))
-> Traversable (Of a)
(a -> f b) -> Of a a -> f (Of a b)
forall a. Functor (Of a)
forall a. Foldable (Of a)
forall a (m :: * -> *) a. Monad m => Of a (m a) -> m (Of a a)
forall a (f :: * -> *) a. Applicative f => Of a (f a) -> f (Of a a)
forall a (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Of a a -> m (Of a b)
forall a (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Of a a -> f (Of 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 => Of a (m a) -> m (Of a a)
forall (f :: * -> *) a. Applicative f => Of a (f a) -> f (Of a a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Of a a -> m (Of a b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Of a a -> f (Of a b)
sequence :: Of a (m a) -> m (Of a a)
$csequence :: forall a (m :: * -> *) a. Monad m => Of a (m a) -> m (Of a a)
mapM :: (a -> m b) -> Of a a -> m (Of a b)
$cmapM :: forall a (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Of a a -> m (Of a b)
sequenceA :: Of a (f a) -> f (Of a a)
$csequenceA :: forall a (f :: * -> *) a. Applicative f => Of a (f a) -> f (Of a a)
traverse :: (a -> f b) -> Of a a -> f (Of a b)
$ctraverse :: forall a (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Of a a -> f (Of a b)
$cp2Traversable :: forall a. Foldable (Of a)
$cp1Traversable :: forall a. Functor (Of a)
Traversable, Typeable, (forall x. Of a b -> Rep (Of a b) x)
-> (forall x. Rep (Of a b) x -> Of a b) -> Generic (Of a b)
forall x. Rep (Of a b) x -> Of a b
forall x. Of a b -> Rep (Of a b) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a b x. Rep (Of a b) x -> Of a b
forall a b x. Of a b -> Rep (Of a b) x
$cto :: forall a b x. Rep (Of a b) x -> Of a b
$cfrom :: forall a b x. Of a b -> Rep (Of a b) x
Generic, (forall a. Of a a -> Rep1 (Of a) a)
-> (forall a. Rep1 (Of a) a -> Of a a) -> Generic1 (Of a)
forall a. Rep1 (Of a) a -> Of a a
forall a. Of a a -> Rep1 (Of a) a
forall a a. Rep1 (Of a) a -> Of a a
forall a a. Of a a -> Rep1 (Of a) a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a a. Rep1 (Of a) a -> Of a a
$cfrom1 :: forall a a. Of a a -> Rep1 (Of a) a
Generic1)
infixr 5 :>
instance (Semigroup a, Semigroup b) => Semigroup (Of a b) where
(a
m :> b
w) <> :: Of a b -> Of a b -> Of a b
<> (a
m' :> b
w') = (a
m a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
m') a -> b -> Of a b
forall a b. a -> b -> Of a b
:> (b
w b -> b -> b
forall a. Semigroup a => a -> a -> a
<> b
w')
{-#INLINE (<>) #-}
instance (Monoid a, Monoid b) => Monoid (Of a b) where
mempty :: Of a b
mempty = a
forall a. Monoid a => a
mempty a -> b -> Of a b
forall a b. a -> b -> Of a b
:> b
forall a. Monoid a => a
mempty
{-#INLINE mempty #-}
#if !(MIN_VERSION_base(4,11,0))
mappend (m :> w) (m' :> w') = mappend m m' :> mappend w w'
{-#INLINE mappend #-}
#endif
instance Functor (Of a) where
fmap :: (a -> b) -> Of a a -> Of a b
fmap a -> b
f (a
a :> a
x) = a
a a -> b -> Of a b
forall a b. a -> b -> Of a b
:> a -> b
f a
x
{-#INLINE fmap #-}
a
a <$ :: a -> Of a b -> Of a a
<$ (a
b :> b
_) = a
b a -> a -> Of a a
forall a b. a -> b -> Of a b
:> a
a
{-#INLINE (<$) #-}
#if MIN_VERSION_base(4,8,0)
instance Bifunctor Of where
bimap :: (a -> b) -> (c -> d) -> Of a c -> Of b d
bimap a -> b
f c -> d
g (a
a :> c
b) = a -> b
f a
a b -> d -> Of b d
forall a b. a -> b -> Of a b
:> c -> d
g c
b
{-#INLINE bimap #-}
first :: (a -> b) -> Of a c -> Of b c
first a -> b
f (a
a :> c
b) = a -> b
f a
a b -> c -> Of b c
forall a b. a -> b -> Of a b
:> c
b
{-#INLINE first #-}
second :: (b -> c) -> Of a b -> Of a c
second b -> c
g (a
a :> b
b) = a
a a -> c -> Of a c
forall a b. a -> b -> Of a b
:> b -> c
g b
b
{-#INLINE second #-}
#endif
#if MIN_VERSION_base(4,10,0)
instance Bifoldable Of where
bifoldMap :: (a -> m) -> (b -> m) -> Of a b -> m
bifoldMap a -> m
f b -> m
g (a
a :> b
b) = a -> m
f a
a m -> m -> m
forall a. Monoid a => a -> a -> a
`mappend` b -> m
g b
b
{-#INLINE bifoldMap #-}
instance Bitraversable Of where
bitraverse :: (a -> f c) -> (b -> f d) -> Of a b -> f (Of c d)
bitraverse a -> f c
f b -> f d
g (a
a :> b
b) = c -> d -> Of c d
forall a b. a -> b -> Of a b
(:>) (c -> d -> Of c d) -> f c -> f (d -> Of c d)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> f c
f a
a f (d -> Of c d) -> f d -> f (Of c d)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> b -> f d
g b
b
{-#INLINE bitraverse #-}
#endif
instance Monoid a => Applicative (Of a) where
pure :: a -> Of a a
pure a
x = a
forall a. Monoid a => a
mempty a -> a -> Of a a
forall a b. a -> b -> Of a b
:> a
x
{-#INLINE pure #-}
(a
m :> a -> b
f) <*> :: Of a (a -> b) -> Of a a -> Of a b
<*> (a
m' :> a
x) = a -> a -> a
forall a. Monoid a => a -> a -> a
mappend a
m a
m' a -> b -> Of a b
forall a b. a -> b -> Of a b
:> a -> b
f a
x
{-#INLINE (<*>) #-}
(a
m :> a
_) *> :: Of a a -> Of a b -> Of a b
*> (a
m' :> b
y) = a -> a -> a
forall a. Monoid a => a -> a -> a
mappend a
m a
m' a -> b -> Of a b
forall a b. a -> b -> Of a b
:> b
y
{-#INLINE (*>) #-}
(a
m :> a
x) <* :: Of a a -> Of a b -> Of a a
<* (a
m' :> b
_) = a -> a -> a
forall a. Monoid a => a -> a -> a
mappend a
m a
m' a -> a -> Of a a
forall a b. a -> b -> Of a b
:> a
x
{-#INLINE (<*) #-}
instance Monoid a => Monad (Of a) where
return :: a -> Of a a
return = a -> Of a a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
{-#INLINE return #-}
(a
m :> a
_) >> :: Of a a -> Of a b -> Of a b
>> (a
m' :> b
y) = a -> a -> a
forall a. Monoid a => a -> a -> a
mappend a
m a
m' a -> b -> Of a b
forall a b. a -> b -> Of a b
:> b
y
{-#INLINE (>>) #-}
(a
m :> a
x) >>= :: Of a a -> (a -> Of a b) -> Of a b
>>= a -> Of a b
f = let a
m' :> b
y = a -> Of a b
f a
x in a -> a -> a
forall a. Monoid a => a -> a -> a
mappend a
m a
m' a -> b -> Of a b
forall a b. a -> b -> Of a b
:> b
y
{-#INLINE (>>=) #-}
#if MIN_VERSION_base(4,9,0)
instance Show a => Show1 (Of a) where
liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Of a a -> ShowS
liftShowsPrec = (Int -> a -> ShowS)
-> ([a] -> ShowS)
-> (Int -> a -> ShowS)
-> ([a] -> ShowS)
-> Int
-> Of a a
-> ShowS
forall (f :: * -> * -> *) a b.
Show2 f =>
(Int -> a -> ShowS)
-> ([a] -> ShowS)
-> (Int -> b -> ShowS)
-> ([b] -> ShowS)
-> Int
-> f a b
-> ShowS
liftShowsPrec2 Int -> a -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec [a] -> ShowS
forall a. Show a => [a] -> ShowS
showList
instance Eq a => Eq1 (Of a) where
liftEq :: (a -> b -> Bool) -> Of a a -> Of a b -> Bool
liftEq = (a -> a -> Bool) -> (a -> b -> Bool) -> Of a a -> Of a b -> Bool
forall (f :: * -> * -> *) a b c d.
Eq2 f =>
(a -> b -> Bool) -> (c -> d -> Bool) -> f a c -> f b d -> Bool
liftEq2 a -> a -> Bool
forall a. Eq a => a -> a -> Bool
(==)
instance Ord a => Ord1 (Of a) where
liftCompare :: (a -> b -> Ordering) -> Of a a -> Of a b -> Ordering
liftCompare = (a -> a -> Ordering)
-> (a -> b -> Ordering) -> Of a a -> Of a b -> Ordering
forall (f :: * -> * -> *) a b c d.
Ord2 f =>
(a -> b -> Ordering)
-> (c -> d -> Ordering) -> f a c -> f b d -> Ordering
liftCompare2 a -> a -> Ordering
forall a. Ord a => a -> a -> Ordering
compare
instance Show2 Of where
liftShowsPrec2 :: (Int -> a -> ShowS)
-> ([a] -> ShowS)
-> (Int -> b -> ShowS)
-> ([b] -> ShowS)
-> Int
-> Of a b
-> ShowS
liftShowsPrec2 Int -> a -> ShowS
spa [a] -> ShowS
_sla Int -> b -> ShowS
spb [b] -> ShowS
_slb Int
p (a
a :> b
b) =
Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
5) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$
Int -> a -> ShowS
spa Int
6 a
a ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
String -> ShowS
showString String
" :> " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Int -> b -> ShowS
spb Int
6 b
b
instance Eq2 Of where
liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Of a c -> Of b d -> Bool
liftEq2 a -> b -> Bool
f c -> d -> Bool
g (a
x :> c
y) (b
z :> d
w) = a -> b -> Bool
f a
x b
z Bool -> Bool -> Bool
&& c -> d -> Bool
g c
y d
w
instance Ord2 Of where
liftCompare2 :: (a -> b -> Ordering)
-> (c -> d -> Ordering) -> Of a c -> Of b d -> Ordering
liftCompare2 a -> b -> Ordering
comp1 c -> d -> Ordering
comp2 (a
x :> c
y) (b
z :> d
w) =
a -> b -> Ordering
comp1 a
x b
z Ordering -> Ordering -> Ordering
forall a. Monoid a => a -> a -> a
`mappend` c -> d -> Ordering
comp2 c
y d
w
#endif