{-# LANGUAGE PolyKinds #-}
module Barbies.Internal.Trivial
  ( Void
  , Unit (..)
  )

where

import Barbies.Internal.ApplicativeB(ApplicativeB(..))
import Barbies.Internal.ConstraintsB(ConstraintsB(..))
import Barbies.Internal.FunctorB(FunctorB(..))
import Barbies.Internal.DistributiveB(DistributiveB(..))
import Barbies.Internal.TraversableB(TraversableB(..))

import Data.Data (Data(..))
import Data.Kind (Type)
import Data.Typeable (Typeable)
import GHC.Generics (Generic)

---------------------------------------------------
-- Trivial Barbies
---------------------------------------------------

-- | Uninhabited barbie type.
data Void (f :: k -> Type)
  deriving ((forall x. Void f -> Rep (Void f) x)
-> (forall x. Rep (Void f) x -> Void f) -> Generic (Void f)
forall x. Rep (Void f) x -> Void f
forall x. Void f -> Rep (Void f) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall k (f :: k -> *) x. Rep (Void f) x -> Void f
forall k (f :: k -> *) x. Void f -> Rep (Void f) x
$cto :: forall k (f :: k -> *) x. Rep (Void f) x -> Void f
$cfrom :: forall k (f :: k -> *) x. Void f -> Rep (Void f) x
Generic, Typeable)

instance Eq   (Void f) where
  == :: Void f -> Void f -> Bool
(==) Void f
v = case Void f
v of

instance Ord  (Void f) where
  compare :: Void f -> Void f -> Ordering
compare Void f
v = case Void f
v of

instance Show (Void f) where
  showsPrec :: Int -> Void f -> ShowS
showsPrec Int
_ Void f
v = case Void f
v of

instance Semigroup (Void f) where
  <> :: Void f -> Void f -> Void f
(<>) Void f
v = case Void f
v of


instance FunctorB Void
instance TraversableB Void
instance ConstraintsB Void


-- | A barbie type without structure.
data Unit (f :: k -> Type)
  = Unit
  deriving
    ( Typeable (Unit f)
DataType
Constr
Typeable (Unit f)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Unit f -> c (Unit f))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Unit f))
-> (Unit f -> Constr)
-> (Unit f -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Unit f)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Unit f)))
-> ((forall b. Data b => b -> b) -> Unit f -> Unit f)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Unit f -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Unit f -> r)
-> (forall u. (forall d. Data d => d -> u) -> Unit f -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Unit f -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Unit f -> m (Unit f))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Unit f -> m (Unit f))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Unit f -> m (Unit f))
-> Data (Unit f)
Unit f -> DataType
Unit f -> Constr
(forall b. Data b => b -> b) -> Unit f -> Unit f
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Unit f -> c (Unit f)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Unit f)
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) -> Unit f -> u
forall u. (forall d. Data d => d -> u) -> Unit f -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Unit f -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Unit f -> r
forall k (f :: k -> *).
(Typeable f, Typeable k) =>
Typeable (Unit f)
forall k (f :: k -> *).
(Typeable f, Typeable k) =>
Unit f -> DataType
forall k (f :: k -> *).
(Typeable f, Typeable k) =>
Unit f -> Constr
forall k (f :: k -> *).
(Typeable f, Typeable k) =>
(forall b. Data b => b -> b) -> Unit f -> Unit f
forall k (f :: k -> *) u.
(Typeable f, Typeable k) =>
Int -> (forall d. Data d => d -> u) -> Unit f -> u
forall k (f :: k -> *) u.
(Typeable f, Typeable k) =>
(forall d. Data d => d -> u) -> Unit f -> [u]
forall k (f :: k -> *) r r'.
(Typeable f, Typeable k) =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Unit f -> r
forall k (f :: k -> *) r r'.
(Typeable f, Typeable k) =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Unit f -> r
forall k (f :: k -> *) (m :: * -> *).
(Typeable f, Typeable k, Monad m) =>
(forall d. Data d => d -> m d) -> Unit f -> m (Unit f)
forall k (f :: k -> *) (m :: * -> *).
(Typeable f, Typeable k, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Unit f -> m (Unit f)
forall k (f :: k -> *) (c :: * -> *).
(Typeable f, Typeable k) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Unit f)
forall k (f :: k -> *) (c :: * -> *).
(Typeable f, Typeable k) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Unit f -> c (Unit f)
forall k (f :: k -> *) (t :: * -> *) (c :: * -> *).
(Typeable f, Typeable k, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Unit f))
forall k (f :: k -> *) (t :: * -> * -> *) (c :: * -> *).
(Typeable f, Typeable k, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Unit f))
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Unit f -> m (Unit f)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Unit f -> m (Unit f)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Unit f)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Unit f -> c (Unit f)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Unit f))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Unit f))
$cUnit :: Constr
$tUnit :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Unit f -> m (Unit f)
$cgmapMo :: forall k (f :: k -> *) (m :: * -> *).
(Typeable f, Typeable k, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Unit f -> m (Unit f)
gmapMp :: (forall d. Data d => d -> m d) -> Unit f -> m (Unit f)
$cgmapMp :: forall k (f :: k -> *) (m :: * -> *).
(Typeable f, Typeable k, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Unit f -> m (Unit f)
gmapM :: (forall d. Data d => d -> m d) -> Unit f -> m (Unit f)
$cgmapM :: forall k (f :: k -> *) (m :: * -> *).
(Typeable f, Typeable k, Monad m) =>
(forall d. Data d => d -> m d) -> Unit f -> m (Unit f)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Unit f -> u
$cgmapQi :: forall k (f :: k -> *) u.
(Typeable f, Typeable k) =>
Int -> (forall d. Data d => d -> u) -> Unit f -> u
gmapQ :: (forall d. Data d => d -> u) -> Unit f -> [u]
$cgmapQ :: forall k (f :: k -> *) u.
(Typeable f, Typeable k) =>
(forall d. Data d => d -> u) -> Unit f -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Unit f -> r
$cgmapQr :: forall k (f :: k -> *) r r'.
(Typeable f, Typeable k) =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Unit f -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Unit f -> r
$cgmapQl :: forall k (f :: k -> *) r r'.
(Typeable f, Typeable k) =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Unit f -> r
gmapT :: (forall b. Data b => b -> b) -> Unit f -> Unit f
$cgmapT :: forall k (f :: k -> *).
(Typeable f, Typeable k) =>
(forall b. Data b => b -> b) -> Unit f -> Unit f
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Unit f))
$cdataCast2 :: forall k (f :: k -> *) (t :: * -> * -> *) (c :: * -> *).
(Typeable f, Typeable k, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Unit f))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Unit f))
$cdataCast1 :: forall k (f :: k -> *) (t :: * -> *) (c :: * -> *).
(Typeable f, Typeable k, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Unit f))
dataTypeOf :: Unit f -> DataType
$cdataTypeOf :: forall k (f :: k -> *).
(Typeable f, Typeable k) =>
Unit f -> DataType
toConstr :: Unit f -> Constr
$ctoConstr :: forall k (f :: k -> *).
(Typeable f, Typeable k) =>
Unit f -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Unit f)
$cgunfold :: forall k (f :: k -> *) (c :: * -> *).
(Typeable f, Typeable k) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Unit f)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Unit f -> c (Unit f)
$cgfoldl :: forall k (f :: k -> *) (c :: * -> *).
(Typeable f, Typeable k) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Unit f -> c (Unit f)
$cp1Data :: forall k (f :: k -> *).
(Typeable f, Typeable k) =>
Typeable (Unit f)
Data, (forall x. Unit f -> Rep (Unit f) x)
-> (forall x. Rep (Unit f) x -> Unit f) -> Generic (Unit f)
forall x. Rep (Unit f) x -> Unit f
forall x. Unit f -> Rep (Unit f) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall k (f :: k -> *) x. Rep (Unit f) x -> Unit f
forall k (f :: k -> *) x. Unit f -> Rep (Unit f) x
$cto :: forall k (f :: k -> *) x. Rep (Unit f) x -> Unit f
$cfrom :: forall k (f :: k -> *) x. Unit f -> Rep (Unit f) x
Generic, Typeable
    , Unit f -> Unit f -> Bool
(Unit f -> Unit f -> Bool)
-> (Unit f -> Unit f -> Bool) -> Eq (Unit f)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall k (f :: k -> *). Unit f -> Unit f -> Bool
/= :: Unit f -> Unit f -> Bool
$c/= :: forall k (f :: k -> *). Unit f -> Unit f -> Bool
== :: Unit f -> Unit f -> Bool
$c== :: forall k (f :: k -> *). Unit f -> Unit f -> Bool
Eq, Eq (Unit f)
Eq (Unit f)
-> (Unit f -> Unit f -> Ordering)
-> (Unit f -> Unit f -> Bool)
-> (Unit f -> Unit f -> Bool)
-> (Unit f -> Unit f -> Bool)
-> (Unit f -> Unit f -> Bool)
-> (Unit f -> Unit f -> Unit f)
-> (Unit f -> Unit f -> Unit f)
-> Ord (Unit f)
Unit f -> Unit f -> Bool
Unit f -> Unit f -> Ordering
Unit f -> Unit f -> Unit f
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 k (f :: k -> *). Eq (Unit f)
forall k (f :: k -> *). Unit f -> Unit f -> Bool
forall k (f :: k -> *). Unit f -> Unit f -> Ordering
forall k (f :: k -> *). Unit f -> Unit f -> Unit f
min :: Unit f -> Unit f -> Unit f
$cmin :: forall k (f :: k -> *). Unit f -> Unit f -> Unit f
max :: Unit f -> Unit f -> Unit f
$cmax :: forall k (f :: k -> *). Unit f -> Unit f -> Unit f
>= :: Unit f -> Unit f -> Bool
$c>= :: forall k (f :: k -> *). Unit f -> Unit f -> Bool
> :: Unit f -> Unit f -> Bool
$c> :: forall k (f :: k -> *). Unit f -> Unit f -> Bool
<= :: Unit f -> Unit f -> Bool
$c<= :: forall k (f :: k -> *). Unit f -> Unit f -> Bool
< :: Unit f -> Unit f -> Bool
$c< :: forall k (f :: k -> *). Unit f -> Unit f -> Bool
compare :: Unit f -> Unit f -> Ordering
$ccompare :: forall k (f :: k -> *). Unit f -> Unit f -> Ordering
$cp1Ord :: forall k (f :: k -> *). Eq (Unit f)
Ord, ReadPrec [Unit f]
ReadPrec (Unit f)
Int -> ReadS (Unit f)
ReadS [Unit f]
(Int -> ReadS (Unit f))
-> ReadS [Unit f]
-> ReadPrec (Unit f)
-> ReadPrec [Unit f]
-> Read (Unit f)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall k (f :: k -> *). ReadPrec [Unit f]
forall k (f :: k -> *). ReadPrec (Unit f)
forall k (f :: k -> *). Int -> ReadS (Unit f)
forall k (f :: k -> *). ReadS [Unit f]
readListPrec :: ReadPrec [Unit f]
$creadListPrec :: forall k (f :: k -> *). ReadPrec [Unit f]
readPrec :: ReadPrec (Unit f)
$creadPrec :: forall k (f :: k -> *). ReadPrec (Unit f)
readList :: ReadS [Unit f]
$creadList :: forall k (f :: k -> *). ReadS [Unit f]
readsPrec :: Int -> ReadS (Unit f)
$creadsPrec :: forall k (f :: k -> *). Int -> ReadS (Unit f)
Read, Int -> Unit f -> ShowS
[Unit f] -> ShowS
Unit f -> String
(Int -> Unit f -> ShowS)
-> (Unit f -> String) -> ([Unit f] -> ShowS) -> Show (Unit f)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (f :: k -> *). Int -> Unit f -> ShowS
forall k (f :: k -> *). [Unit f] -> ShowS
forall k (f :: k -> *). Unit f -> String
showList :: [Unit f] -> ShowS
$cshowList :: forall k (f :: k -> *). [Unit f] -> ShowS
show :: Unit f -> String
$cshow :: forall k (f :: k -> *). Unit f -> String
showsPrec :: Int -> Unit f -> ShowS
$cshowsPrec :: forall k (f :: k -> *). Int -> Unit f -> ShowS
Show
    )

instance Semigroup (Unit f) where
  Unit f
Unit <> :: Unit f -> Unit f -> Unit f
<> Unit f
Unit = Unit f
forall k (f :: k -> *). Unit f
Unit

instance Monoid (Unit f) where
  mempty :: Unit f
mempty  = Unit f
forall k (f :: k -> *). Unit f
Unit
  mappend :: Unit f -> Unit f -> Unit f
mappend = Unit f -> Unit f -> Unit f
forall a. Semigroup a => a -> a -> a
(<>)

instance FunctorB Unit
instance DistributiveB Unit
instance TraversableB Unit
instance ApplicativeB Unit
instance ConstraintsB Unit