symantic-base-0.5.0.20221211: Basic symantic combinators for Embedded Domain-Specific Languages (EDSL)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Symantic.Syntaxes.Classes

Description

Combinators in this module conflict with usual ones from the Prelude hence they are meant to be imported either explicitely or qualified.

Synopsis

Type Syntax

Type family Syntaxes

type family Syntaxes (syns :: [Syntax]) (sem :: Semantic) :: Constraint where ... Source #

Merge several Syntaxes into a single one.

Useful in IfSemantic.

Equations

Syntaxes '[] sem = () 
Syntaxes (syn ': syns) sem = (syn sem, Syntaxes syns sem) 

Class Abstractable

class Unabstractable sem => Abstractable sem where Source #

Minimal complete definition

Nothing

Methods

lam :: (sem a -> sem b) -> sem (a -> b) Source #

Lambda term abstraction, in HOAS (Higher-Order Abstract Syntax) style.

default lam :: FromDerived Abstractable sem => Derivable sem => (sem a -> sem b) -> sem (a -> b) Source #

lam1 :: (sem a -> sem b) -> sem (a -> b) Source #

Like lam but whose argument must be used only once, hence safe to beta-reduce (inline) without duplicating work.

default lam1 :: FromDerived Abstractable sem => Derivable sem => (sem a -> sem b) -> sem (a -> b) Source #

var :: sem a -> sem a Source #

default var :: FromDerived1 Abstractable sem => sem a -> sem a Source #

Instances

Instances details
Abstractable Viewer Source # 
Instance details

Defined in Symantic.Semantics.Viewer

Methods

lam :: (Viewer a -> Viewer b) -> Viewer (a -> b) Source #

lam1 :: (Viewer a -> Viewer b) -> Viewer (a -> b) Source #

var :: Viewer a -> Viewer a Source #

Abstractable sem => Abstractable (SomeData sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

lam :: (SomeData sem a -> SomeData sem b) -> SomeData sem (a -> b) Source #

lam1 :: (SomeData sem a -> SomeData sem b) -> SomeData sem (a -> b) Source #

var :: SomeData sem a -> SomeData sem a Source #

Abstractable sem => Abstractable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

lam :: (Reader r sem a -> Reader r sem b) -> Reader r sem (a -> b) Source #

lam1 :: (Reader r sem a -> Reader r sem b) -> Reader r sem (a -> b) Source #

var :: Reader r sem a -> Reader r sem a Source #

Abstractable sem => Derivable (Data Abstractable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Abstractable sem a Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Abstractable sem a where

Class Unabstractable

class Unabstractable sem where Source #

Minimal complete definition

Nothing

Methods

(.@) :: sem (a -> b) -> sem a -> sem b infixl 9 Source #

Application, aka. unabstract.

default (.@) :: FromDerived2 Unabstractable sem => sem (a -> b) -> sem a -> sem b Source #

Instances

Instances details
Unabstractable Viewer Source # 
Instance details

Defined in Symantic.Semantics.Viewer

Methods

(.@) :: Viewer (a -> b) -> Viewer a -> Viewer b Source #

Unabstractable sem => Unabstractable (SomeData sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

(.@) :: SomeData sem (a -> b) -> SomeData sem a -> SomeData sem b Source #

Unabstractable sem => Unabstractable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

(.@) :: Reader r sem (a -> b) -> Reader r sem a -> Reader r sem b Source #

Unabstractable sem => Derivable (Data Unabstractable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Unabstractable sem a Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Unabstractable sem a where

Class Functionable

class Functionable sem where Source #

Minimal complete definition

Nothing

Methods

const :: sem (a -> b -> a) Source #

default const :: FromDerived Functionable sem => sem (a -> b -> a) Source #

flip :: sem ((a -> b -> c) -> b -> a -> c) Source #

default flip :: FromDerived Functionable sem => sem ((a -> b -> c) -> b -> a -> c) Source #

id :: sem (a -> a) Source #

default id :: FromDerived Functionable sem => sem (a -> a) Source #

(.) :: sem ((b -> c) -> (a -> b) -> a -> c) infixr 9 Source #

default (.) :: FromDerived Functionable sem => sem ((b -> c) -> (a -> b) -> a -> c) Source #

($) :: sem ((a -> b) -> a -> b) infixr 0 Source #

default ($) :: FromDerived Functionable sem => sem ((a -> b) -> a -> b) Source #

Instances

Instances details
Abstractable sem => Functionable (SomeData sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

const :: SomeData sem (a -> b -> a) Source #

flip :: SomeData sem ((a -> b -> c) -> b -> a -> c) Source #

id :: SomeData sem (a -> a) Source #

(.) :: SomeData sem ((b -> c) -> (a -> b) -> a -> c) Source #

($) :: SomeData sem ((a -> b) -> a -> b) Source #

Functionable sem => Functionable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

const :: Reader r sem (a -> b -> a) Source #

flip :: Reader r sem ((a -> b -> c) -> b -> a -> c) Source #

id :: Reader r sem (a -> a) Source #

(.) :: Reader r sem ((b -> c) -> (a -> b) -> a -> c) Source #

($) :: Reader r sem ((a -> b) -> a -> b) Source #

Class Anythingable

class Anythingable sem where Source #

Minimal complete definition

Nothing

Methods

anything :: sem a -> sem a Source #

Instances

Instances details
Anythingable Viewer Source # 
Instance details

Defined in Symantic.Semantics.Viewer

Methods

anything :: Viewer a -> Viewer a Source #

Anythingable (SomeData sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

anything :: SomeData sem a -> SomeData sem a Source #

Anythingable sem => Anythingable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

anything :: Reader r sem a -> Reader r sem a Source #

Anythingable (Data Anythingable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Anythingable sem => Derivable (Data Anythingable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Anythingable sem a Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Anythingable sem a where

Class Bottomable

class Bottomable sem where Source #

Methods

bottom :: sem a Source #

Instances

Instances details
Bottomable Viewer Source # 
Instance details

Defined in Symantic.Semantics.Viewer

Methods

bottom :: Viewer a Source #

Bottomable sem => Derivable (Data Bottomable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

derive :: Data Bottomable sem a -> Derived (Data Bottomable sem) a Source #

data Data Bottomable sem a Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Bottomable sem a where

Class Constantable

class Constantable c sem where Source #

Minimal complete definition

Nothing

Methods

constant :: c -> sem c Source #

default constant :: FromDerived (Constantable c) sem => c -> sem c Source #

Instances

Instances details
Show c => Constantable c Viewer Source # 
Instance details

Defined in Symantic.Semantics.Viewer

Methods

constant :: c -> Viewer c Source #

(Constantable c sem, Typeable c) => Constantable c (SomeData sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

constant :: c -> SomeData sem c Source #

Constantable c sem => Constantable c (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

constant :: c -> Reader r sem c Source #

Constantable c (Data (Constantable c) sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

constant :: c -> Data (Constantable c) sem c Source #

Constantable c sem => Derivable (Data (Constantable c) sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

derive :: Data (Constantable c) sem a -> Derived (Data (Constantable c) sem) a Source #

data Data (Constantable c) sem a Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data (Constantable c) sem a where

Class Eitherable

class Eitherable sem where Source #

Minimal complete definition

Nothing

Methods

either :: sem ((l -> a) -> (r -> a) -> Either l r -> a) Source #

default either :: FromDerived Eitherable sem => sem ((l -> a) -> (r -> a) -> Either l r -> a) Source #

left :: sem (l -> Either l r) Source #

default left :: FromDerived Eitherable sem => sem (l -> Either l r) Source #

right :: sem (r -> Either l r) Source #

default right :: FromDerived Eitherable sem => sem (r -> Either l r) Source #

Instances

Instances details
Eitherable Viewer Source # 
Instance details

Defined in Symantic.Semantics.Viewer

Methods

either :: Viewer ((l -> a) -> (r -> a) -> Either l r -> a) Source #

left :: Viewer (l -> Either l r) Source #

right :: Viewer (r -> Either l r) Source #

Eitherable sem => Eitherable (SomeData sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

either :: SomeData sem ((l -> a) -> (r -> a) -> Either l r -> a) Source #

left :: SomeData sem (l -> Either l r) Source #

right :: SomeData sem (r -> Either l r) Source #

Eitherable sem => Eitherable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

either :: Reader r sem ((l -> a) -> (r0 -> a) -> Either l r0 -> a) Source #

left :: Reader r sem (l -> Either l r0) Source #

right :: Reader r sem (r0 -> Either l r0) Source #

Eitherable (Data Eitherable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

either :: Data Eitherable sem ((l -> a) -> (r -> a) -> Either l r -> a) Source #

left :: Data Eitherable sem (l -> Either l r) Source #

right :: Data Eitherable sem (r -> Either l r) Source #

Eitherable sem => Derivable (Data Eitherable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

derive :: Data Eitherable sem a -> Derived (Data Eitherable sem) a Source #

data Data Eitherable sem a Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Eitherable sem a where

Class Equalable

class Equalable sem where Source #

Minimal complete definition

Nothing

Methods

equal :: Eq a => sem (a -> a -> Bool) infix 4 Source #

default equal :: FromDerived Equalable sem => Eq a => sem (a -> a -> Bool) Source #

Instances

Instances details
Equalable Viewer Source # 
Instance details

Defined in Symantic.Semantics.Viewer

Methods

equal :: Eq a => Viewer (a -> a -> Bool) Source #

Equalable sem => Equalable (SomeData sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

equal :: Eq a => SomeData sem (a -> a -> Bool) Source #

Equalable sem => Equalable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

equal :: Eq a => Reader r sem (a -> a -> Bool) Source #

Equalable (Data Equalable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

equal :: Eq a => Data Equalable sem (a -> a -> Bool) Source #

Equalable sem => Derivable (Data Equalable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

derive :: Data Equalable sem a -> Derived (Data Equalable sem) a Source #

data Data Equalable sem a Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Equalable sem a where

(==) :: Abstractable sem => Equalable sem => Eq a => sem a -> sem a -> sem Bool infix 4 Source #

Class IfThenElseable

class IfThenElseable sem where Source #

Minimal complete definition

Nothing

Methods

ifThenElse :: sem Bool -> sem a -> sem a -> sem a Source #

default ifThenElse :: FromDerived3 IfThenElseable sem => sem Bool -> sem a -> sem a -> sem a Source #

Instances

Instances details
IfThenElseable sem => IfThenElseable (SomeData sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

ifThenElse :: SomeData sem Bool -> SomeData sem a -> SomeData sem a -> SomeData sem a Source #

IfThenElseable sem => IfThenElseable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

ifThenElse :: Reader r sem Bool -> Reader r sem a -> Reader r sem a -> Reader r sem a Source #

IfThenElseable sem => IfThenElseable (Data IfThenElseable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

IfThenElseable sem => Derivable (Data IfThenElseable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data IfThenElseable sem a Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data IfThenElseable sem a where

Class Inferable

class Inferable a sem where Source #

Minimal complete definition

Nothing

Methods

infer :: sem a Source #

default infer :: FromDerived (Inferable a) sem => sem a Source #

unit :: Inferable () sem => sem () Source #

bool :: Inferable Bool sem => sem Bool Source #

char :: Inferable Char sem => sem Char Source #

int :: Inferable Int sem => sem Int Source #

Class Listable

class Listable sem where Source #

Minimal complete definition

Nothing

Methods

cons :: sem (a -> [a] -> [a]) Source #

default cons :: FromDerived Listable sem => sem (a -> [a] -> [a]) Source #

nil :: sem [a] Source #

default nil :: FromDerived Listable sem => sem [a] Source #

Instances

Instances details
Listable Viewer Source # 
Instance details

Defined in Symantic.Semantics.Viewer

Methods

cons :: Viewer (a -> [a] -> [a]) Source #

nil :: Viewer [a] Source #

Listable sem => Listable (SomeData sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

cons :: SomeData sem (a -> [a] -> [a]) Source #

nil :: SomeData sem [a] Source #

Listable sem => Listable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

cons :: Reader r sem (a -> [a] -> [a]) Source #

nil :: Reader r sem [a] Source #

Listable (Data Listable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

cons :: Data Listable sem (a -> [a] -> [a]) Source #

nil :: Data Listable sem [a] Source #

Listable sem => Derivable (Data Listable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

derive :: Data Listable sem a -> Derived (Data Listable sem) a Source #

data Data Listable sem a Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Listable sem a where

Class Maybeable

class Maybeable sem where Source #

Minimal complete definition

Nothing

Methods

nothing :: sem (Maybe a) Source #

default nothing :: FromDerived Maybeable sem => sem (Maybe a) Source #

just :: sem (a -> Maybe a) Source #

default just :: FromDerived Maybeable sem => sem (a -> Maybe a) Source #

Instances

Instances details
Maybeable Viewer Source # 
Instance details

Defined in Symantic.Semantics.Viewer

Methods

nothing :: Viewer (Maybe a) Source #

just :: Viewer (a -> Maybe a) Source #

Maybeable sem => Maybeable (SomeData sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

nothing :: SomeData sem (Maybe a) Source #

just :: SomeData sem (a -> Maybe a) Source #

Maybeable sem => Maybeable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

nothing :: Reader r sem (Maybe a) Source #

just :: Reader r sem (a -> Maybe a) Source #

Maybeable (Data Maybeable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

nothing :: Data Maybeable sem (Maybe a) Source #

just :: Data Maybeable sem (a -> Maybe a) Source #

Maybeable sem => Derivable (Data Maybeable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

derive :: Data Maybeable sem a -> Derived (Data Maybeable sem) a Source #

data Data Maybeable sem a Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Maybeable sem a where

Class IsoFunctor

class IsoFunctor sem where Source #

Minimal complete definition

Nothing

Methods

(<%>) :: Iso a b -> sem a -> sem b infixl 4 Source #

default (<%>) :: FromDerived1 IsoFunctor sem => Iso a b -> sem a -> sem b Source #

Instances

Instances details
IsoFunctor sem => IsoFunctor (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

(<%>) :: Iso a b -> Reader r sem a -> Reader r sem b Source #

Type Iso

data Iso a b Source #

Constructors

Iso 

Fields

  • a2b :: a -> b
     
  • b2a :: b -> a
     

Instances

Instances details
Category Iso Source # 
Instance details

Defined in Symantic.Syntaxes.Classes

Methods

id :: forall (a :: k). Iso a a #

(.) :: forall (b :: k) (c :: k) (a :: k). Iso b c -> Iso a b -> Iso a c #

Class ProductFunctor

class ProductFunctor sem where Source #

Beware that this is an infixr, not infixl like <*>; this is to follow what is expected by ADT.

Minimal complete definition

Nothing

Methods

(<.>) :: sem a -> sem b -> sem (a, b) infixr 4 Source #

default (<.>) :: FromDerived2 ProductFunctor sem => sem a -> sem b -> sem (a, b) Source #

(<.) :: sem a -> sem () -> sem a infixr 4 Source #

default (<.) :: IsoFunctor sem => sem a -> sem () -> sem a Source #

(.>) :: sem () -> sem a -> sem a infixr 4 Source #

default (.>) :: IsoFunctor sem => sem () -> sem a -> sem a Source #

Instances

Instances details
(ProductFunctor sem, Monad sem) => ProductFunctor (ToFer sem) Source # 
Instance details

Defined in Symantic.Semantics.ToFer

Methods

(<.>) :: ToFer sem a -> ToFer sem b -> ToFer sem (a, b) Source #

(<.) :: ToFer sem a -> ToFer sem () -> ToFer sem a Source #

(.>) :: ToFer sem () -> ToFer sem a -> ToFer sem a Source #

(ProductFunctor sem, IsoFunctor sem) => ProductFunctor (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

(<.>) :: Reader r sem a -> Reader r sem b -> Reader r sem (a, b) Source #

(<.) :: Reader r sem a -> Reader r sem () -> Reader r sem a Source #

(.>) :: Reader r sem () -> Reader r sem a -> Reader r sem a Source #

Class SumFunctor

class SumFunctor sem where Source #

Beware that this is an infixr, not infixl like <|>; this is to follow what is expected by ADT.

Minimal complete definition

Nothing

Methods

(<+>) :: sem a -> sem b -> sem (Either a b) infixr 3 Source #

default (<+>) :: FromDerived2 SumFunctor sem => sem a -> sem b -> sem (Either a b) Source #

Instances

Instances details
(SumFunctor sem, AlternativeFunctor sem) => SumFunctor (ToFer sem) Source # 
Instance details

Defined in Symantic.Semantics.ToFer

Methods

(<+>) :: ToFer sem a -> ToFer sem b -> ToFer sem (Either a b) Source #

(SumFunctor sem, IsoFunctor sem) => SumFunctor (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

(<+>) :: Reader r sem a -> Reader r sem b -> Reader r sem (Either a b) Source #

pattern (:!:) :: a -> b -> (a, b) infixr 4 Source #

Like (,) but infixr. Mostly useful for clarity when using SumFunctor.

Class AlternativeFunctor

class AlternativeFunctor sem where Source #

Beware that this is an infixr, not infixl like <|>; this is to follow what is expected by ADT.

Minimal complete definition

Nothing

Methods

(<|>) :: sem a -> sem a -> sem a infixr 3 Source #

default (<|>) :: FromDerived2 AlternativeFunctor sem => sem a -> sem a -> sem a Source #

Instances

Instances details
AlternativeFunctor sem => AlternativeFunctor (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

(<|>) :: Reader r sem a -> Reader r sem a -> Reader r sem a Source #

Class Dicurryable

class Dicurryable sem where Source #

Minimal complete definition

Nothing

Methods

dicurry :: CurryN args => proxy args -> (args -..-> a) -> (a -> Tuples args) -> sem (Tuples args) -> sem a Source #

default dicurry :: FromDerived1 Dicurryable sem => CurryN args => proxy args -> (args -..-> a) -> (a -> Tuples args) -> sem (Tuples args) -> sem a Source #

Instances

Instances details
Dicurryable sem => Dicurryable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

dicurry :: forall (args :: [Type]) proxy a. CurryN args => proxy args -> (args -..-> a) -> (a -> Tuples args) -> Reader r sem (Tuples args) -> Reader r sem a Source #

construct :: forall args a sem. Dicurryable sem => Generic a => EoTOfRep a => CurryN args => Tuples args ~ EoT (ADT a) => args ~ Args (args -..-> a) => (args -..-> a) -> sem (Tuples args) -> sem a Source #

Class Dataable

class Dataable sem where Source #

Enable the contruction or deconstruction of a any algebraic data type

Minimal complete definition

Nothing

Methods

data_ :: Generic a => RepOfEoT a => UnToF a => sem (EoT (ADT a)) -> sem a Source #

default data_ :: Generic a => RepOfEoT a => EoTOfRep a => IsoFunctor sem => sem (EoT (ADT a)) -> sem a Source #

Instances

Instances details
Functor sem => Dataable (ToFer sem) Source # 
Instance details

Defined in Symantic.Semantics.ToFer

Methods

data_ :: (Generic a, RepOfEoT a, UnToF a) => ToFer sem (EoT (ADT a)) -> ToFer sem a Source #

dataType :: forall a sem. Dataable sem => Generic a => RepOfEoT a => UnToF a => sem (EoT (ADT a)) -> sem a Source #

Like data_ but with the (a) type parameter first for convenience when specifying it.

Class IfSemantic

class IfSemantic (thenSyntaxes :: [Syntax]) (elseSyntaxes :: [Syntax]) thenSemantic elseSemantic where Source #

IfSemantic enables to change the Syntax for a specific Semantic.

Useful when a Semantic does not implement some Syntaxes used by other Semantics.

Methods

ifSemantic :: (Syntaxes thenSyntaxes thenSemantic => thenSemantic a) -> (Syntaxes elseSyntaxes elseSemantic => elseSemantic a) -> elseSemantic a Source #

Instances

Instances details
Syntaxes elseSyntaxes elseSemantic => IfSemantic thenSyntaxes elseSyntaxes thenSemantic elseSemantic Source # 
Instance details

Defined in Symantic.Syntaxes.Classes

Methods

ifSemantic :: (Syntaxes thenSyntaxes thenSemantic => thenSemantic a) -> (Syntaxes elseSyntaxes elseSemantic => elseSemantic a) -> elseSemantic a Source #

Syntaxes thenSyntaxes thenSemantic => IfSemantic thenSyntaxes elseSyntaxes thenSemantic thenSemantic Source # 
Instance details

Defined in Symantic.Syntaxes.Classes

Methods

ifSemantic :: (Syntaxes thenSyntaxes thenSemantic => thenSemantic a) -> (Syntaxes elseSyntaxes thenSemantic => thenSemantic a) -> thenSemantic a Source #

Class Monoidable

class (Emptyable sem, Semigroupable sem) => Monoidable sem Source #

Instances

Instances details
(Emptyable sem, Semigroupable sem) => Monoidable sem Source # 
Instance details

Defined in Symantic.Syntaxes.Classes

Class Emptyable

class Emptyable sem where Source #

Minimal complete definition

Nothing

Methods

empty :: sem a Source #

default empty :: FromDerived Emptyable sem => sem a Source #

Instances

Instances details
Emptyable sem => Emptyable (SomeData sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

empty :: SomeData sem a Source #

Emptyable sem => Emptyable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

empty :: Reader r sem a Source #

Emptyable (Data Emptyable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

empty :: Data Emptyable sem a Source #

Emptyable sem => Derivable (Data Emptyable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

derive :: Data Emptyable sem a -> Derived (Data Emptyable sem) a Source #

data Data Emptyable sem a Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Emptyable sem a where

Class Semigroupable

class Semigroupable sem where Source #

Minimal complete definition

Nothing

Methods

concat :: Semigroup a => sem (a -> a -> a) infixr 6 Source #

default concat :: FromDerived Semigroupable sem => Semigroup a => sem (a -> a -> a) Source #

Instances

Instances details
Semigroupable sem => Semigroupable (SomeData sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

concat :: Semigroup a => SomeData sem (a -> a -> a) Source #

Semigroupable sem => Semigroupable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

concat :: Semigroup a => Reader r sem (a -> a -> a) Source #

Semigroupable (Data Semigroupable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

Methods

concat :: Semigroup a => Data Semigroupable sem (a -> a -> a) Source #

Semigroupable sem => Derivable (Data Semigroupable sem) Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Semigroupable sem a Source # 
Instance details

Defined in Symantic.Syntaxes.Data

data Data Semigroupable sem a where

(<>) :: Abstractable sem => Semigroupable sem => Semigroup a => sem a -> sem a -> sem a infixr 6 Source #

Class Optionable

class Optionable sem where Source #

Minimal complete definition

Nothing

Methods

optional :: sem a -> sem (Maybe a) Source #

default optional :: FromDerived1 Optionable sem => sem a -> sem (Maybe a) Source #

Instances

Instances details
(Optionable sem, Functor sem) => Optionable (ToFer sem) Source # 
Instance details

Defined in Symantic.Semantics.ToFer

Methods

optional :: ToFer sem a -> ToFer sem (Maybe a) Source #

Optionable sem => Optionable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

optional :: Reader r sem a -> Reader r sem (Maybe a) Source #

Class Repeatable

class Repeatable sem where Source #

Minimal complete definition

Nothing

Methods

many0 :: sem a -> sem [a] Source #

default many0 :: FromDerived1 Repeatable sem => sem a -> sem [a] Source #

many1 :: sem a -> sem [a] Source #

default many1 :: FromDerived1 Repeatable sem => sem a -> sem [a] Source #

Instances

Instances details
Repeatable sem => Repeatable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

many0 :: Reader r sem a -> Reader r sem [a] Source #

many1 :: Reader r sem a -> Reader r sem [a] Source #

many :: Repeatable sem => sem a -> sem [a] Source #

Alias to many0.

some :: Repeatable sem => sem a -> sem [a] Source #

Alias to many1.

Class Permutable

class Permutable sem where Source #

Minimal complete definition

permutable, perm, noPerm, permWithDefault

Associated Types

type Permutation (sem :: Semantic) = (r :: Semantic) | r -> sem Source #

Methods

permutable :: Permutation sem a -> sem a Source #

perm :: sem a -> Permutation sem a Source #

noPerm :: Permutation sem () Source #

permWithDefault :: a -> sem a -> Permutation sem a Source #

optionalPerm :: Eitherable sem => IsoFunctor sem => Permutable sem => sem a -> Permutation sem (Maybe a) Source #

(<&>) :: Permutable sem => ProductFunctor (Permutation sem) => sem a -> Permutation sem b -> Permutation sem (a, b) infixr 4 Source #

(<?&>) :: Eitherable sem => IsoFunctor sem => Permutable sem => ProductFunctor (Permutation sem) => sem a -> Permutation sem b -> Permutation sem (Maybe a, b) infixr 4 Source #

(<*&>) :: Eitherable sem => Repeatable sem => IsoFunctor sem => Permutable sem => ProductFunctor (Permutation sem) => sem a -> Permutation sem b -> Permutation sem ([a], b) infixr 4 Source #

(<+&>) :: Eitherable sem => Repeatable sem => IsoFunctor sem => Permutable sem => ProductFunctor (Permutation sem) => sem a -> Permutation sem b -> Permutation sem ([a], b) infixr 4 Source #

Class Voidable

class Voidable sem where Source #

Minimal complete definition

Nothing

Methods

void :: a -> sem a -> sem () Source #

Useful to supply (a) to a (sem) consuming (a), for example in the format of a printing interpreter.

default void :: FromDerived1 Voidable sem => a -> sem a -> sem () Source #

Instances

Instances details
Voidable sem => Voidable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

void :: a -> Reader r sem a -> Reader r sem () Source #

Class Substractable

class Substractable sem where Source #

Minimal complete definition

Nothing

Methods

(<->) :: sem a -> sem b -> sem a infixr 3 Source #

default (<->) :: FromDerived2 Substractable sem => sem a -> sem b -> sem a Source #

Instances

Instances details
Substractable sem => Substractable (Reader r sem) Source # 
Instance details

Defined in Symantic.Semantics.Reader

Methods

(<->) :: Reader r sem a -> Reader r sem b -> Reader r sem a Source #