Safe Haskell | None |
---|---|
Language | Haskell2010 |
- Type
ReprKind
- Class
Abstractable
- Class
Anythingable
- Class
Bottomable
- Class
Constantable
- Class
Eitherable
- Class
Equalable
- Class
IfThenElseable
- Class
Listable
- Class
Maybeable
- Class
IsoFunctor
- Class
ProductFunctor
- Class
AlternativeFunctor
- Class
Dicurryable
- Class
Repeatable
- Class
Permutable
- Class
Routable
- Class
Voidable
- Class
Substractable
Synopsis
- type ReprKind = Type -> Type
- class Abstractable repr where
- (.@) :: repr (a -> b) -> repr a -> repr b
- lam :: (repr a -> repr b) -> repr (a -> b)
- lam1 :: (repr a -> repr b) -> repr (a -> b)
- const :: repr (a -> b -> a)
- flip :: repr ((a -> b -> c) -> b -> a -> c)
- id :: repr (a -> a)
- (.) :: repr ((b -> c) -> (a -> b) -> a -> c)
- ($) :: repr ((a -> b) -> a -> b)
- var :: repr a -> repr a
- 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
- bool :: Constantable Bool repr => Bool -> repr Bool
- char :: Constantable Char repr => Char -> repr Char
- unit :: Constantable () repr => repr ()
- class Eitherable repr where
- class Equalable repr where
- (==) :: (Abstractable repr, Equalable repr, Eq a) => repr (a -> a -> Bool)
- class IfThenElseable repr where
- ifThenElse :: repr Bool -> repr a -> repr a -> repr a
- class Listable repr where
- class Maybeable repr where
- class IsoFunctor repr where
- data Iso a b = Iso {}
- class ProductFunctor repr where
- (<.>) :: repr a -> repr b -> repr (a, b)
- class AlternativeFunctor repr where
- (<+>) :: repr a -> repr a -> repr a
- class Dicurryable repr where
- construct :: forall args a k repr. Dicurryable repr => Generic a => EoTOfRep a => CurryN args => Tuples args ~ EoT (ADT a) => args ~ Args (args -..-> a) => (args -..-> a) -> repr (args -..-> k) -> repr (a -> k)
- adt :: forall adt repr. IsoFunctor repr => Generic adt => RepOfEoT adt => EoTOfRep adt => repr (EoT (ADT adt)) -> repr adt
- class Emptyable repr where
- empty :: 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 :: repr a -> repr ()
- class Substractable repr where
- (<->) :: repr a -> repr b -> repr a
Type ReprKind
Class Abstractable
class Abstractable repr where Source #
Nothing
(.@) :: 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 #
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 #
const :: repr (a -> b -> a) Source #
default const :: FromDerived Abstractable repr => repr (a -> b -> a) Source #
flip :: repr ((a -> b -> c) -> b -> a -> c) Source #
default flip :: FromDerived Abstractable repr => repr ((a -> b -> c) -> b -> a -> c) Source #
default id :: FromDerived Abstractable repr => repr (a -> a) Source #
(.) :: repr ((b -> c) -> (a -> b) -> a -> c) infixr 9 Source #
default (.) :: FromDerived Abstractable repr => repr ((b -> c) -> (a -> b) -> a -> c) Source #
($) :: repr ((a -> b) -> a -> b) infixr 0 Source #
default ($) :: FromDerived Abstractable repr => repr ((a -> b) -> a -> b) Source #
var :: repr a -> repr a Source #
default var :: FromDerived1 Abstractable repr => repr a -> repr a Source #
Instances
Abstractable View Source # | |
Defined in Symantic.View (.@) :: View (a -> b) -> View a -> View b Source # lam :: (View a -> View b) -> View (a -> b) Source # lam1 :: (View a -> View b) -> View (a -> b) Source # const :: View (a -> b -> a) Source # flip :: View ((a -> b -> c) -> b -> a -> c) Source # (.) :: View ((b -> c) -> (a -> b) -> a -> c) Source # | |
Abstractable repr => Abstractable (SomeData repr) Source # | |
Defined in Symantic.Data (.@) :: SomeData repr (a -> b) -> SomeData repr a -> SomeData repr b Source # lam :: (SomeData repr a -> SomeData repr b) -> SomeData repr (a -> b) Source # lam1 :: (SomeData repr a -> SomeData repr b) -> SomeData repr (a -> b) Source # const :: SomeData repr (a -> b -> a) Source # flip :: SomeData repr ((a -> b -> c) -> b -> a -> c) Source # id :: SomeData repr (a -> a) Source # (.) :: SomeData repr ((b -> c) -> (a -> b) -> a -> c) Source # | |
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 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
|
unit :: Constantable () repr => repr () Source #
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
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 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 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) Source #
default (<.>) :: FromDerived2 ProductFunctor repr => repr a -> repr b -> repr (a, b) Source #
Class AlternativeFunctor
class AlternativeFunctor repr where Source #
Nothing
(<+>) :: repr a -> repr a -> repr a Source #
default (<+>) :: FromDerived2 AlternativeFunctor repr => repr a -> repr a -> repr a Source #
Class Dicurryable
class Dicurryable repr where Source #
Nothing
construct :: forall args a k repr. Dicurryable repr => Generic a => EoTOfRep a => CurryN args => Tuples args ~ EoT (ADT a) => args ~ Args (args -..-> a) => (args -..-> a) -> repr (args -..-> k) -> repr (a -> k) Source #
adt :: forall adt repr. IsoFunctor repr => Generic adt => RepOfEoT adt => EoTOfRep adt => repr (EoT (ADT adt)) -> repr adt Source #
Class Emptyable
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 3 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 #