Safe Haskell | None |
---|---|
Language | Haskell2010 |
- Type
ReprKind
- Class
Abstractable
- Class
Anythingable
- Class
Bottomable
- Class
Constantable
- Class
Eitherable
- Class
Equalable
- Class
IfThenElseable
- Class
Inferable
- Class
Listable
- Class
Maybeable
- Class
IsoFunctor
- Class
ProductFunctor
- Class
SumFunctor
- Class
AlternativeFunctor
- Class
Dicurryable
- Class
Monoidable
- Class
Repeatable
- Class
Permutable
- Class
Routable
- Class
Voidable
- Class
Substractable
Synopsis
- type ReprKind = Type -> Type
- class Abstractable repr where
- class Functionable repr where
- class Anythingable repr where
- anything :: repr a -> repr a
- class Bottomable repr where
- bottom :: repr a
- class Constantable c repr where
- constant :: c -> repr c
- class Eitherable repr where
- class Equalable repr where
- (==) :: Abstractable repr => Equalable repr => Eq a => repr a -> repr a -> repr Bool
- class IfThenElseable repr where
- ifThenElse :: repr Bool -> repr a -> repr a -> repr a
- class Inferable a repr where
- infer :: repr a
- unit :: Inferable () repr => repr ()
- bool :: Inferable Bool repr => repr Bool
- char :: Inferable Char repr => repr Char
- int :: Inferable Int repr => repr Int
- natural :: Inferable Natural repr => repr Natural
- string :: Inferable String repr => repr String
- class Listable repr where
- class Maybeable repr where
- class IsoFunctor repr where
- data Iso a b = Iso {}
- class ProductFunctor repr where
- class SumFunctor repr where
- class AlternativeFunctor repr where
- (<|>) :: repr a -> repr a -> repr a
- class Dicurryable repr where
- construct :: forall args a repr. Dicurryable repr => Generic a => EoTOfRep a => CurryN args => Tuples args ~ EoT (ADT a) => args ~ Args (args -..-> a) => (args -..-> a) -> repr (Tuples args) -> repr a
- adt :: forall adt repr. IsoFunctor repr => Generic adt => RepOfEoT adt => EoTOfRep adt => repr (EoT (ADT adt)) -> repr adt
- class (Emptyable repr, Semigroupable repr) => Monoidable repr
- class Emptyable repr where
- empty :: repr a
- class Semigroupable repr where
- (<>) :: Abstractable repr => Semigroupable repr => Semigroup a => repr a -> repr a -> repr a
- class Optionable repr where
- class Repeatable repr where
- class Permutable repr where
- type Permutation (repr :: ReprKind) = (r :: ReprKind) | r -> repr
- permutable :: Permutation repr a -> repr a
- perm :: repr a -> Permutation repr a
- noPerm :: Permutation repr ()
- permWithDefault :: a -> repr a -> Permutation repr a
- optionalPerm :: Eitherable repr => IsoFunctor repr => Permutable repr => repr a -> Permutation repr (Maybe a)
- (<&>) :: Permutable repr => ProductFunctor (Permutation repr) => repr a -> Permutation repr b -> Permutation repr (a, b)
- (<?&>) :: Eitherable repr => IsoFunctor repr => Permutable repr => ProductFunctor (Permutation repr) => repr a -> Permutation repr b -> Permutation repr (Maybe a, b)
- (<*&>) :: Eitherable repr => Repeatable repr => IsoFunctor repr => Permutable repr => ProductFunctor (Permutation repr) => repr a -> Permutation repr b -> Permutation repr ([a], b)
- (<+&>) :: Eitherable repr => Repeatable repr => IsoFunctor repr => Permutable repr => ProductFunctor (Permutation repr) => repr a -> Permutation repr b -> Permutation repr ([a], b)
- class Routable repr where
- (<!>) :: repr a -> repr b -> repr (a, b)
- pattern (:!:) :: a -> b -> (a, b)
- class Voidable repr where
- void :: a -> repr a -> repr ()
- class Substractable repr where
- (<->) :: repr a -> repr b -> repr a
Type ReprKind
Class Abstractable
class Abstractable repr where Source #
Nothing
lam :: (repr a -> repr b) -> repr (a -> b) Source #
Lambda term abstraction, in HOAS (Higher-Order Abstract Syntax) style.
default lam :: FromDerived Abstractable repr => Derivable repr => (repr a -> repr b) -> repr (a -> b) Source #
lam1 :: (repr a -> repr b) -> repr (a -> b) Source #
Like lam
but whose argument is used only once,
hence safe to beta-reduce (inline) without duplicating work.
default lam1 :: FromDerived Abstractable repr => Derivable repr => (repr a -> repr b) -> repr (a -> b) Source #
var :: repr a -> repr a Source #
default var :: FromDerived1 Abstractable repr => repr a -> repr a Source #
(.@) :: repr (a -> b) -> repr a -> repr b infixl 9 Source #
Application, aka. unabstract.
default (.@) :: FromDerived2 Abstractable repr => repr (a -> b) -> repr a -> repr b Source #
Instances
Abstractable View Source # | |
Abstractable repr => Abstractable (SomeData repr) Source # | |
Defined in Symantic.Data | |
Abstractable repr => Derivable (Data Abstractable repr) Source # | |
Defined in Symantic.Data derive :: Data Abstractable repr a -> Derived (Data Abstractable repr) a Source # | |
data Data Abstractable repr a Source # | |
Defined in Symantic.Data data Data Abstractable repr a where
|
Class Functionable
class Functionable repr where Source #
Nothing
const :: repr (a -> b -> a) Source #
default const :: FromDerived Functionable repr => repr (a -> b -> a) Source #
flip :: repr ((a -> b -> c) -> b -> a -> c) Source #
default flip :: FromDerived Functionable repr => repr ((a -> b -> c) -> b -> a -> c) Source #
default id :: FromDerived Functionable repr => repr (a -> a) Source #
(.) :: repr ((b -> c) -> (a -> b) -> a -> c) infixr 9 Source #
default (.) :: FromDerived Functionable repr => repr ((b -> c) -> (a -> b) -> a -> c) Source #
($) :: repr ((a -> b) -> a -> b) infixr 0 Source #
default ($) :: FromDerived Functionable repr => repr ((a -> b) -> a -> b) Source #
Instances
Abstractable repr => Functionable (SomeData repr) Source # | |
Class Anythingable
class Anythingable repr where Source #
Nothing
Instances
Anythingable View Source # | |
Anythingable (SomeData repr) Source # | |
Anythingable repr => Derivable (Data Anythingable repr) Source # | |
Defined in Symantic.Data derive :: Data Anythingable repr a -> Derived (Data Anythingable repr) a Source # | |
Anythingable (Data Anythingable repr) Source # | |
Defined in Symantic.Data anything :: Data Anythingable repr a -> Data Anythingable repr a Source # | |
data Data Anythingable repr a Source # | |
Defined in Symantic.Data data Data Anythingable repr a where
|
Class Bottomable
class Bottomable repr where Source #
Instances
Bottomable View Source # | |
Defined in Symantic.View | |
Bottomable repr => Derivable (Data Bottomable repr) Source # | |
Defined in Symantic.Data derive :: Data Bottomable repr a -> Derived (Data Bottomable repr) a Source # | |
data Data Bottomable repr a Source # | |
Defined in Symantic.Data |
Class Constantable
class Constantable c repr where Source #
Nothing
constant :: c -> repr c Source #
default constant :: FromDerived (Constantable c) repr => c -> repr c Source #
Instances
Show c => Constantable c View Source # | |
Defined in Symantic.View | |
(Constantable c repr, Typeable c) => Constantable c (SomeData repr) Source # | |
Defined in Symantic.Data | |
Constantable c (Data (Constantable c) repr) Source # | |
Defined in Symantic.Data constant :: c -> Data (Constantable c) repr c Source # | |
Constantable c repr => Derivable (Data (Constantable c) repr) Source # | |
Defined in Symantic.Data derive :: Data (Constantable c) repr a -> Derived (Data (Constantable c) repr) a Source # | |
data Data (Constantable c) repr a Source # | |
Defined in Symantic.Data data Data (Constantable c) repr a where
|
Class Eitherable
class Eitherable repr where Source #
Nothing
left :: repr (l -> Either l r) Source #
default left :: FromDerived Eitherable repr => repr (l -> Either l r) Source #
right :: repr (r -> Either l r) Source #
default right :: FromDerived Eitherable repr => repr (r -> Either l r) Source #
Instances
Eitherable View Source # | |
Eitherable repr => Eitherable (SomeData repr) Source # | |
Eitherable repr => Derivable (Data Eitherable repr) Source # | |
Defined in Symantic.Data derive :: Data Eitherable repr a -> Derived (Data Eitherable repr) a Source # | |
Eitherable (Data Eitherable repr) Source # | |
Defined in Symantic.Data | |
data Data Eitherable repr a Source # | |
Defined in Symantic.Data data Data Eitherable repr a where
|
Class Equalable
class Equalable repr where Source #
Nothing
(==) :: Abstractable repr => Equalable repr => Eq a => repr a -> repr a -> repr Bool infix 4 Source #
Class IfThenElseable
class IfThenElseable repr where Source #
Nothing
ifThenElse :: repr Bool -> repr a -> repr a -> repr a Source #
default ifThenElse :: FromDerived3 IfThenElseable repr => repr Bool -> repr a -> repr a -> repr a Source #
Instances
IfThenElseable repr => IfThenElseable (SomeData repr) Source # | |
Defined in Symantic.Data | |
IfThenElseable repr => Derivable (Data IfThenElseable repr) Source # | |
Defined in Symantic.Data derive :: Data IfThenElseable repr a -> Derived (Data IfThenElseable repr) a Source # | |
IfThenElseable repr => IfThenElseable (Data IfThenElseable repr) Source # | |
Defined in Symantic.Data ifThenElse :: Data IfThenElseable repr Bool -> Data IfThenElseable repr a -> Data IfThenElseable repr a -> Data IfThenElseable repr a Source # | |
data Data IfThenElseable repr a Source # | |
Defined in Symantic.Data data Data IfThenElseable repr a where
|
Class Inferable
Class Listable
class Listable repr where Source #
Nothing
cons :: repr (a -> [a] -> [a]) Source #
default cons :: FromDerived Listable repr => repr (a -> [a] -> [a]) Source #
default nil :: FromDerived Listable repr => repr [a] Source #
Class Maybeable
class Maybeable repr where Source #
Nothing
Class IsoFunctor
class IsoFunctor repr where Source #
Nothing
(<%>) :: Iso a b -> repr a -> repr b infixl 4 Source #
default (<%>) :: FromDerived1 IsoFunctor repr => Iso a b -> repr a -> repr b Source #
Type Iso
Class ProductFunctor
class ProductFunctor repr where Source #
Nothing
(<.>) :: repr a -> repr b -> repr (a, b) infixr 4 Source #
default (<.>) :: FromDerived2 ProductFunctor repr => repr a -> repr b -> repr (a, b) Source #
(<.) :: repr a -> repr () -> repr a infixr 4 Source #
default (<.) :: IsoFunctor repr => repr a -> repr () -> repr a Source #
(.>) :: repr () -> repr a -> repr a infixr 4 Source #
default (.>) :: IsoFunctor repr => repr () -> repr a -> repr a Source #
Class SumFunctor
class SumFunctor repr where Source #
Nothing
(<+>) :: repr a -> repr b -> repr (Either a b) infixr 3 Source #
default (<+>) :: FromDerived2 SumFunctor repr => repr a -> repr b -> repr (Either a b) Source #
Class AlternativeFunctor
class AlternativeFunctor repr where Source #
Nothing
(<|>) :: repr a -> repr a -> repr a infixr 3 Source #
default (<|>) :: FromDerived2 AlternativeFunctor repr => repr a -> repr a -> repr a Source #
Class Dicurryable
class Dicurryable repr where Source #
Nothing
construct :: forall args a repr. Dicurryable repr => Generic a => EoTOfRep a => CurryN args => Tuples args ~ EoT (ADT a) => args ~ Args (args -..-> a) => (args -..-> a) -> repr (Tuples args) -> repr a Source #
adt :: forall adt repr. IsoFunctor repr => Generic adt => RepOfEoT adt => EoTOfRep adt => repr (EoT (ADT adt)) -> repr adt Source #
Class Monoidable
class (Emptyable repr, Semigroupable repr) => Monoidable repr Source #
Instances
(Emptyable repr, Semigroupable repr) => Monoidable repr Source # | |
Defined in Symantic.Class |
Class Emptyable
class Emptyable repr where Source #
Nothing
Class Semigroupable
class Semigroupable repr where Source #
Nothing
concat :: Semigroup a => repr (a -> a -> a) infixr 6 Source #
default concat :: FromDerived Semigroupable repr => Semigroup a => repr (a -> a -> a) Source #
Instances
Semigroupable repr => Semigroupable (SomeData repr) Source # | |
Semigroupable repr => Derivable (Data Semigroupable repr) Source # | |
Defined in Symantic.Data derive :: Data Semigroupable repr a -> Derived (Data Semigroupable repr) a Source # | |
Semigroupable (Data Semigroupable repr) Source # | |
Defined in Symantic.Data | |
data Data Semigroupable repr a Source # | |
Defined in Symantic.Data data Data Semigroupable repr a where
|
(<>) :: Abstractable repr => Semigroupable repr => Semigroup a => repr a -> repr a -> repr a infixr 6 Source #
Class Optionable
class Optionable repr where Source #
Nothing
option :: repr a -> repr a Source #
default option :: FromDerived1 Optionable repr => repr a -> repr a Source #
optional :: repr a -> repr (Maybe a) Source #
default optional :: FromDerived1 Optionable repr => repr a -> repr (Maybe a) Source #
Class Repeatable
class Repeatable repr where Source #
Nothing
many0 :: repr a -> repr [a] Source #
default many0 :: FromDerived1 Repeatable repr => repr a -> repr [a] Source #
many1 :: repr a -> repr [a] Source #
default many1 :: FromDerived1 Repeatable repr => repr a -> repr [a] Source #
Class Permutable
class Permutable repr where Source #
type Permutation (repr :: ReprKind) = (r :: ReprKind) | r -> repr Source #
type Permutation repr = Permutation (Derived repr)
permutable :: Permutation repr a -> repr a Source #
perm :: repr a -> Permutation repr a Source #
noPerm :: Permutation repr () Source #
permWithDefault :: a -> repr a -> Permutation repr a Source #
optionalPerm :: Eitherable repr => IsoFunctor repr => Permutable repr => repr a -> Permutation repr (Maybe a) Source #
(<&>) :: Permutable repr => ProductFunctor (Permutation repr) => repr a -> Permutation repr b -> Permutation repr (a, b) infixr 4 Source #
(<?&>) :: Eitherable repr => IsoFunctor repr => Permutable repr => ProductFunctor (Permutation repr) => repr a -> Permutation repr b -> Permutation repr (Maybe a, b) infixr 4 Source #
(<*&>) :: Eitherable repr => Repeatable repr => IsoFunctor repr => Permutable repr => ProductFunctor (Permutation repr) => repr a -> Permutation repr b -> Permutation repr ([a], b) infixr 4 Source #
(<+&>) :: Eitherable repr => Repeatable repr => IsoFunctor repr => Permutable repr => ProductFunctor (Permutation repr) => repr a -> Permutation repr b -> Permutation repr ([a], b) infixr 4 Source #
Class Routable
pattern (:!:) :: a -> b -> (a, b) infixr 4 Source #
Like (,)
but infixr
.
Mostly useful for clarity when using Routable
.
Class Voidable
Class Substractable
class Substractable repr where Source #
Nothing
(<->) :: repr a -> repr b -> repr a infixr 3 Source #
default (<->) :: FromDerived2 Substractable repr => repr a -> repr b -> repr a Source #