{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Data.Ten.Ap
(
Ap10(..)
) where
import Data.Kind (Constraint, Type)
import GHC.Generics (Generic)
import Control.DeepSeq (NFData)
import Data.Default.Class (Default(..))
import Data.Hashable (Hashable(..))
import Data.Portray (Portray(..))
import Data.Portray.Diff (Diff)
import Data.Wrapped (Wrapped(..))
newtype Ap10 (a :: k) (f :: k -> Type) = Ap10 { Ap10 a f -> f a
unAp10 :: f a }
deriving (forall x. Ap10 a f -> Rep (Ap10 a f) x)
-> (forall x. Rep (Ap10 a f) x -> Ap10 a f) -> Generic (Ap10 a f)
forall x. Rep (Ap10 a f) x -> Ap10 a f
forall x. Ap10 a f -> Rep (Ap10 a f) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall k (a :: k) (f :: k -> *) x. Rep (Ap10 a f) x -> Ap10 a f
forall k (a :: k) (f :: k -> *) x. Ap10 a f -> Rep (Ap10 a f) x
$cto :: forall k (a :: k) (f :: k -> *) x. Rep (Ap10 a f) x -> Ap10 a f
$cfrom :: forall k (a :: k) (f :: k -> *) x. Ap10 a f -> Rep (Ap10 a f) x
Generic
newtype Decoy a = Decoy ()
deriving stock (Decoy a -> Decoy a -> Bool
(Decoy a -> Decoy a -> Bool)
-> (Decoy a -> Decoy a -> Bool) -> Eq (Decoy a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall k (a :: k). Decoy a -> Decoy a -> Bool
/= :: Decoy a -> Decoy a -> Bool
$c/= :: forall k (a :: k). Decoy a -> Decoy a -> Bool
== :: Decoy a -> Decoy a -> Bool
$c== :: forall k (a :: k). Decoy a -> Decoy a -> Bool
Eq, Eq (Decoy a)
Eq (Decoy a)
-> (Decoy a -> Decoy a -> Ordering)
-> (Decoy a -> Decoy a -> Bool)
-> (Decoy a -> Decoy a -> Bool)
-> (Decoy a -> Decoy a -> Bool)
-> (Decoy a -> Decoy a -> Bool)
-> (Decoy a -> Decoy a -> Decoy a)
-> (Decoy a -> Decoy a -> Decoy a)
-> Ord (Decoy a)
Decoy a -> Decoy a -> Bool
Decoy a -> Decoy a -> Ordering
Decoy a -> Decoy a -> Decoy 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 k (a :: k). Eq (Decoy a)
forall k (a :: k). Decoy a -> Decoy a -> Bool
forall k (a :: k). Decoy a -> Decoy a -> Ordering
forall k (a :: k). Decoy a -> Decoy a -> Decoy a
min :: Decoy a -> Decoy a -> Decoy a
$cmin :: forall k (a :: k). Decoy a -> Decoy a -> Decoy a
max :: Decoy a -> Decoy a -> Decoy a
$cmax :: forall k (a :: k). Decoy a -> Decoy a -> Decoy a
>= :: Decoy a -> Decoy a -> Bool
$c>= :: forall k (a :: k). Decoy a -> Decoy a -> Bool
> :: Decoy a -> Decoy a -> Bool
$c> :: forall k (a :: k). Decoy a -> Decoy a -> Bool
<= :: Decoy a -> Decoy a -> Bool
$c<= :: forall k (a :: k). Decoy a -> Decoy a -> Bool
< :: Decoy a -> Decoy a -> Bool
$c< :: forall k (a :: k). Decoy a -> Decoy a -> Bool
compare :: Decoy a -> Decoy a -> Ordering
$ccompare :: forall k (a :: k). Decoy a -> Decoy a -> Ordering
$cp1Ord :: forall k (a :: k). Eq (Decoy a)
Ord, ReadPrec [Decoy a]
ReadPrec (Decoy a)
Int -> ReadS (Decoy a)
ReadS [Decoy a]
(Int -> ReadS (Decoy a))
-> ReadS [Decoy a]
-> ReadPrec (Decoy a)
-> ReadPrec [Decoy a]
-> Read (Decoy a)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall k (a :: k). ReadPrec [Decoy a]
forall k (a :: k). ReadPrec (Decoy a)
forall k (a :: k). Int -> ReadS (Decoy a)
forall k (a :: k). ReadS [Decoy a]
readListPrec :: ReadPrec [Decoy a]
$creadListPrec :: forall k (a :: k). ReadPrec [Decoy a]
readPrec :: ReadPrec (Decoy a)
$creadPrec :: forall k (a :: k). ReadPrec (Decoy a)
readList :: ReadS [Decoy a]
$creadList :: forall k (a :: k). ReadS [Decoy a]
readsPrec :: Int -> ReadS (Decoy a)
$creadsPrec :: forall k (a :: k). Int -> ReadS (Decoy a)
Read, Int -> Decoy a -> ShowS
[Decoy a] -> ShowS
Decoy a -> String
(Int -> Decoy a -> ShowS)
-> (Decoy a -> String) -> ([Decoy a] -> ShowS) -> Show (Decoy a)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (a :: k). Int -> Decoy a -> ShowS
forall k (a :: k). [Decoy a] -> ShowS
forall k (a :: k). Decoy a -> String
showList :: [Decoy a] -> ShowS
$cshowList :: forall k (a :: k). [Decoy a] -> ShowS
show :: Decoy a -> String
$cshow :: forall k (a :: k). Decoy a -> String
showsPrec :: Int -> Decoy a -> ShowS
$cshowsPrec :: forall k (a :: k). Int -> Decoy a -> ShowS
Show, (forall x. Decoy a -> Rep (Decoy a) x)
-> (forall x. Rep (Decoy a) x -> Decoy a) -> Generic (Decoy a)
forall x. Rep (Decoy a) x -> Decoy a
forall x. Decoy a -> Rep (Decoy a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall k (a :: k) x. Rep (Decoy a) x -> Decoy a
forall k (a :: k) x. Decoy a -> Rep (Decoy a) x
$cto :: forall k (a :: k) x. Rep (Decoy a) x -> Decoy a
$cfrom :: forall k (a :: k) x. Decoy a -> Rep (Decoy a) x
Generic)
deriving newtype (Decoy a
Decoy a -> Default (Decoy a)
forall a. a -> Default a
forall k (a :: k). Decoy a
def :: Decoy a
$cdef :: forall k (a :: k). Decoy a
Default, Decoy a -> ()
(Decoy a -> ()) -> NFData (Decoy a)
forall a. (a -> ()) -> NFData a
forall k (a :: k). Decoy a -> ()
rnf :: Decoy a -> ()
$crnf :: forall k (a :: k). Decoy a -> ()
NFData, Int -> Decoy a -> Int
Decoy a -> Int
(Int -> Decoy a -> Int) -> (Decoy a -> Int) -> Hashable (Decoy a)
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
forall k (a :: k). Int -> Decoy a -> Int
forall k (a :: k). Decoy a -> Int
hash :: Decoy a -> Int
$chash :: forall k (a :: k). Decoy a -> Int
hashWithSalt :: Int -> Decoy a -> Int
$chashWithSalt :: forall k (a :: k). Int -> Decoy a -> Int
Hashable)
deriving (Decoy a -> Decoy a -> Maybe Portrayal
(Decoy a -> Decoy a -> Maybe Portrayal) -> Diff (Decoy a)
forall a. (a -> a -> Maybe Portrayal) -> Diff a
forall k (a :: k). Decoy a -> Decoy a -> Maybe Portrayal
diff :: Decoy a -> Decoy a -> Maybe Portrayal
$cdiff :: forall k (a :: k). Decoy a -> Decoy a -> Maybe Portrayal
Diff, Decoy a -> Portrayal
(Decoy a -> Portrayal) -> Portray (Decoy a)
forall a. (a -> Portrayal) -> Portray a
forall k (a :: k). Decoy a -> Portrayal
portray :: Decoy a -> Portrayal
$cportray :: forall k (a :: k). Decoy a -> Portrayal
Portray) via Wrapped Generic (Decoy a)
class (forall a. PortrayCtx f a => Portray (f a))
=> PortrayAp (f :: k -> Type) where
type PortrayCtx f :: k -> Constraint
instance (forall a. Portray a => Portray (f a)) => PortrayAp f where
type PortrayCtx f = Portray
instance {-# OVERLAPS #-} PortrayAp (Decoy :: Type -> Type) where
type PortrayCtx Decoy = Portray
deriving newtype instance (PortrayCtx f a, PortrayAp f) => Portray (Ap10 a f)
class (forall a. DiffCtx f a => Diff (f a)) => DiffAp (f :: k -> Type) where
type DiffCtx f :: k -> Constraint
instance (forall a. Diff a => Diff (f a)) => DiffAp f where
type DiffCtx f = Diff
instance {-# OVERLAPS #-} DiffAp (Decoy :: Type -> Type) where
type DiffCtx Decoy = Diff
deriving newtype instance (DiffCtx f a, DiffAp f) => Diff (Ap10 a f)
class (forall a. EqCtx f a => Eq (f a)) => EqAp (f :: k -> Type) where
type EqCtx f :: k -> Constraint
instance (forall a. Eq a => Eq (f a)) => EqAp f where
type EqCtx f = Eq
instance {-# OVERLAPS #-} EqAp (Decoy :: Type -> Type) where
type EqCtx Decoy = Eq
deriving newtype instance (EqCtx f a, EqAp f) => Eq (Ap10 a f)
class (forall a. OrdCtx f a => Ord (f a)) => OrdAp (f :: k -> Type) where
type OrdCtx f :: k -> Constraint
instance (forall a. Ord a => Ord (f a)) => OrdAp f where
type OrdCtx f = Ord
instance {-# OVERLAPS #-} OrdAp (Decoy :: Type -> Type) where
type OrdCtx Decoy = Ord
deriving newtype
instance (OrdCtx f a, OrdAp f, EqCtx f a, EqAp f) => Ord (Ap10 a f)
class (forall a. ReadCtx f a => Read (f a)) => ReadAp (f :: k -> Type) where
type ReadCtx f :: k -> Constraint
instance (forall a. Read a => Read (f a)) => ReadAp f where
type ReadCtx f = Read
instance {-# OVERLAPS #-} ReadAp (Decoy :: Type -> Type) where
type ReadCtx Decoy = Read
deriving newtype instance (ReadCtx f a, ReadAp f) => Read (Ap10 a f)
class (forall a. ShowCtx f a => Show (f a)) => ShowAp (f :: k -> Type) where
type ShowCtx f :: k -> Constraint
instance (forall a. Show a => Show (f a)) => ShowAp f where
type ShowCtx f = Show
instance {-# OVERLAPS #-} ShowAp (Decoy :: Type -> Type) where
type ShowCtx Decoy = Show
deriving newtype instance (ShowCtx f a, ShowAp f) => Show (Ap10 a f)
class (forall a. DefaultCtx f a => Default (f a)) => DefaultAp (f :: k -> Type) where
type DefaultCtx f :: k -> Constraint
instance (forall a. Default a => Default (f a)) => DefaultAp f where
type DefaultCtx f = Default
instance {-# OVERLAPS #-} DefaultAp (Decoy :: Type -> Type) where
type DefaultCtx Decoy = Default
deriving newtype instance (DefaultCtx f a, DefaultAp f) => Default (Ap10 a f)
class (forall a. NFDataCtx f a => NFData (f a)) => NFDataAp (f :: k -> Type) where
type NFDataCtx f :: k -> Constraint
instance (forall a. NFData a => NFData (f a)) => NFDataAp f where
type NFDataCtx f = NFData
instance {-# OVERLAPS #-} NFDataAp (Decoy :: Type -> Type) where
type NFDataCtx Decoy = NFData
deriving newtype instance (NFDataCtx f a, NFDataAp f) => NFData (Ap10 a f)
class (forall a. HashableCtx f a => Hashable (f a)) => HashableAp (f :: k -> Type) where
type HashableCtx f :: k -> Constraint
instance (forall a. Hashable a => Hashable (f a)) => HashableAp f where
type HashableCtx f = Hashable
instance {-# OVERLAPS #-} HashableAp (Decoy :: Type -> Type) where
type HashableCtx Decoy = Hashable
deriving newtype instance (HashableCtx f a, HashableAp f) => Hashable (Ap10 a f)