Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type family Derived (repr :: Type -> Type) :: Type -> Type
- class Derivable repr where
- class LiftDerived repr where
- liftDerived :: Derived repr a -> repr a
- class LiftDerived1 repr where
- liftDerived1 :: (Derived repr a -> Derived repr b) -> repr a -> repr b
- class LiftDerived2 repr where
- liftDerived2 :: (Derived repr a -> Derived repr b -> Derived repr c) -> repr a -> repr b -> repr c
- class LiftDerived3 repr where
- liftDerived3 :: (Derived repr a -> Derived repr b -> Derived repr c -> Derived repr d) -> repr a -> repr b -> repr c -> repr d
- class LiftDerived4 repr where
- type FromDerived sym repr = (LiftDerived repr, sym (Derived repr))
- type FromDerived1 sym repr = (LiftDerived1 repr, sym (Derived repr))
- type FromDerived2 sym repr = (LiftDerived2 repr, sym (Derived repr))
- type FromDerived3 sym repr = (LiftDerived3 repr, sym (Derived repr))
- type FromDerived4 sym repr = (LiftDerived4 repr, sym (Derived repr))
Type family Derived
type family Derived (repr :: Type -> Type) :: Type -> Type Source #
The representation that (repr)
derives to.
Instances
type Derived View Source # | Unusual, but enables to leverage default definition of methods. |
Defined in Symantic.View | |
type Derived (SomeData repr) Source # | |
Defined in Symantic.Data | |
type Derived (Data able repr) Source # | |
Defined in Symantic.Data | |
type Derived (FinalizeSharing _letName repr) Source # | |
Defined in Symantic.ObserveSharing | |
type Derived (ObserveSharing letName repr) Source # | |
Defined in Symantic.ObserveSharing |
Class Derivable
class Derivable repr where Source #
Derive an interpreter to a another interpreter
determined by the Derived
open type family.
This is mostly useful when running the interpreter stack,
but also when going back from an initial encoding to a final one.
Note that derive
and liftDerived
are not necessarily reciprocical functions.
Instances
Class LiftDerived
class LiftDerived repr where Source #
Lift the Derived
interpreter of an interpreter, to that interpreter.
This is mostly useful to give default values to class methods
in order to skip their definition for interpreters
where liftDerived
can already apply the right semantic.
Note that derive
and liftDerived
are not necessarily reciprocical functions.
liftDerived :: Derived repr a -> repr a Source #
Instances
LiftDerived View Source # | |
Defined in Symantic.View | |
(Eq letName, Hashable letName) => LiftDerived (FinalizeSharing letName repr) Source # | |
Defined in Symantic.ObserveSharing liftDerived :: Derived (FinalizeSharing letName repr) a -> FinalizeSharing letName repr a Source # | |
(Referenceable letName repr, MakeLetName letName, Eq letName, Hashable letName, Show letName) => LiftDerived (ObserveSharing letName repr) Source # | |
Defined in Symantic.ObserveSharing liftDerived :: Derived (ObserveSharing letName repr) a -> ObserveSharing letName repr a Source # |
Class LiftDerived1
class LiftDerived1 repr where Source #
Convenient wrapper of derive
and liftDerived
for functions with a single argument.
Nothing
liftDerived1 :: (Derived repr a -> Derived repr b) -> repr a -> repr b Source #
default liftDerived1 :: LiftDerived repr => Derivable repr => (Derived repr a -> Derived repr b) -> repr a -> repr b Source #
Instances
(Eq letName, Hashable letName) => LiftDerived1 (FinalizeSharing letName repr) Source # | |
Defined in Symantic.ObserveSharing liftDerived1 :: (Derived (FinalizeSharing letName repr) a -> Derived (FinalizeSharing letName repr) b) -> FinalizeSharing letName repr a -> FinalizeSharing letName repr b Source # | |
(Referenceable letName repr, MakeLetName letName, Eq letName, Hashable letName, Show letName) => LiftDerived1 (ObserveSharing letName repr) Source # | |
Defined in Symantic.ObserveSharing liftDerived1 :: (Derived (ObserveSharing letName repr) a -> Derived (ObserveSharing letName repr) b) -> ObserveSharing letName repr a -> ObserveSharing letName repr b Source # |
Class LiftDerived2
class LiftDerived2 repr where Source #
Convenient wrapper of derive
and liftDerived
for functions with two arguments.
Note that the default instance relies upon LiftDerived
, not LiftDerived1
.
Nothing
liftDerived2 :: (Derived repr a -> Derived repr b -> Derived repr c) -> repr a -> repr b -> repr c Source #
default liftDerived2 :: LiftDerived repr => Derivable repr => (Derived repr a -> Derived repr b -> Derived repr c) -> repr a -> repr b -> repr c Source #
Instances
(Eq letName, Hashable letName) => LiftDerived2 (FinalizeSharing letName repr) Source # | |
Defined in Symantic.ObserveSharing liftDerived2 :: (Derived (FinalizeSharing letName repr) a -> Derived (FinalizeSharing letName repr) b -> Derived (FinalizeSharing letName repr) c) -> FinalizeSharing letName repr a -> FinalizeSharing letName repr b -> FinalizeSharing letName repr c Source # | |
(Referenceable letName repr, MakeLetName letName, Eq letName, Hashable letName, Show letName) => LiftDerived2 (ObserveSharing letName repr) Source # | |
Defined in Symantic.ObserveSharing liftDerived2 :: (Derived (ObserveSharing letName repr) a -> Derived (ObserveSharing letName repr) b -> Derived (ObserveSharing letName repr) c) -> ObserveSharing letName repr a -> ObserveSharing letName repr b -> ObserveSharing letName repr c Source # |
Class LiftDerived3
class LiftDerived3 repr where Source #
Convenient wrapper of derive
and liftDerived
for functions with three arguments.
Note that the default instance relies upon LiftDerived
, not LiftDerived2
.
Nothing
liftDerived3 :: (Derived repr a -> Derived repr b -> Derived repr c -> Derived repr d) -> repr a -> repr b -> repr c -> repr d Source #
default liftDerived3 :: LiftDerived repr => Derivable repr => (Derived repr a -> Derived repr b -> Derived repr c -> Derived repr d) -> repr a -> repr b -> repr c -> repr d Source #
Instances
(Eq letName, Hashable letName) => LiftDerived3 (FinalizeSharing letName repr) Source # | |
Defined in Symantic.ObserveSharing liftDerived3 :: (Derived (FinalizeSharing letName repr) a -> Derived (FinalizeSharing letName repr) b -> Derived (FinalizeSharing letName repr) c -> Derived (FinalizeSharing letName repr) d) -> FinalizeSharing letName repr a -> FinalizeSharing letName repr b -> FinalizeSharing letName repr c -> FinalizeSharing letName repr d Source # | |
(Referenceable letName repr, MakeLetName letName, Eq letName, Hashable letName, Show letName) => LiftDerived3 (ObserveSharing letName repr) Source # | |
Defined in Symantic.ObserveSharing liftDerived3 :: (Derived (ObserveSharing letName repr) a -> Derived (ObserveSharing letName repr) b -> Derived (ObserveSharing letName repr) c -> Derived (ObserveSharing letName repr) d) -> ObserveSharing letName repr a -> ObserveSharing letName repr b -> ObserveSharing letName repr c -> ObserveSharing letName repr d Source # |
Class LiftDerived4
class LiftDerived4 repr where Source #
Convenient wrapper of derive
and liftDerived
for functions with three arguments.
Note that the default instance relies upon LiftDerived
, not LiftDerived3
.
Nothing
liftDerived4 :: (Derived repr a -> Derived repr b -> Derived repr c -> Derived repr d -> Derived repr e) -> repr a -> repr b -> repr c -> repr d -> repr e Source #
default liftDerived4 :: LiftDerived repr => Derivable repr => (Derived repr a -> Derived repr b -> Derived repr c -> Derived repr d -> Derived repr e) -> repr a -> repr b -> repr c -> repr d -> repr e Source #
Instances
(Eq letName, Hashable letName) => LiftDerived4 (FinalizeSharing letName repr) Source # | |
Defined in Symantic.ObserveSharing liftDerived4 :: (Derived (FinalizeSharing letName repr) a -> Derived (FinalizeSharing letName repr) b -> Derived (FinalizeSharing letName repr) c -> Derived (FinalizeSharing letName repr) d -> Derived (FinalizeSharing letName repr) e) -> FinalizeSharing letName repr a -> FinalizeSharing letName repr b -> FinalizeSharing letName repr c -> FinalizeSharing letName repr d -> FinalizeSharing letName repr e Source # | |
(Referenceable letName repr, MakeLetName letName, Eq letName, Hashable letName, Show letName) => LiftDerived4 (ObserveSharing letName repr) Source # | |
Defined in Symantic.ObserveSharing liftDerived4 :: (Derived (ObserveSharing letName repr) a -> Derived (ObserveSharing letName repr) b -> Derived (ObserveSharing letName repr) c -> Derived (ObserveSharing letName repr) d -> Derived (ObserveSharing letName repr) e) -> ObserveSharing letName repr a -> ObserveSharing letName repr b -> ObserveSharing letName repr c -> ObserveSharing letName repr d -> ObserveSharing letName repr e Source # |
Type synonyms FromDerived*
type FromDerived sym repr = (LiftDerived repr, sym (Derived repr)) Source #
Convenient type synonym for using liftDerived
on symantic class (sym)
.
type FromDerived1 sym repr = (LiftDerived1 repr, sym (Derived repr)) Source #
type FromDerived2 sym repr = (LiftDerived2 repr, sym (Derived repr)) Source #
type FromDerived3 sym repr = (LiftDerived3 repr, sym (Derived repr)) Source #
type FromDerived4 sym repr = (LiftDerived4 repr, sym (Derived repr)) Source #