Module
Data.Smash
- Package
- purescript-smash
- Repository
- paf31/purescript-smash
#Smash Source
data Smash (r :: Row Type) (a :: Type)
Smash a bunch of functors together with Day convolution
The representation is abstract but can be understood in terms of
the defintion of Day
:
Day f g a ~ ∃x y. (f x, g y, x -> y -> a)
So for a smash product of several functors, we need a supply xⱼ of existential variables, and then we define
Smash f a = ∃x1 ... xⱼ. (Πⱼ fⱼ xⱼ,, Πⱼ xⱼ -> a)
which we represent using a record.
Instances
Functor (Smash r)
(RowToList r rl, ExtendSmash rl r) => Extend (Smash r)
(RowToList r rl, ComonadSmash rl r) => Comonad (Smash r)
#FProxy Source
data FProxy (f :: Type -> Type)
A value-level representation of a functor, so that we can use
some mono-kinded compiler-provided machinery like RowCons
.
Constructors
Instances
(Extend f, IsSymbol l, RowCons l (FProxy f) r1 r, ExtendSmash rl r1) => ExtendSmash (Cons l (FProxy f) rl) r
(Comonad f, IsSymbol l, RowCons l (FProxy f) r1 r, ComonadSmash rl r1) => ComonadSmash (Cons l (FProxy f) rl) r
#Smashed Source
class Smashed rl interpreters proxies results | rl -> interpreters proxies results where
Members
Instances
Smashed Nil () () ()
(IsSymbol l, RowLacks l results_, RowLacks l interpreters_, RowLacks l proxies_, RowCons l (f a) interpreters_ interpreters, RowCons l (FProxy f) proxies_ proxies, RowCons l a results_ results, Smashed rl interpreters_ proxies_ results_) => Smashed (Cons l (f a) rl) interpreters proxies results
#ExtendSmash Source
class ExtendSmash rl r | rl -> r where
Members
duplicateSmashRL :: forall a. RLProxy rl -> Smash r a -> Smash r (Smash r a)
Instances
ExtendSmash Nil ()
(Extend f, IsSymbol l, RowCons l (FProxy f) r1 r, ExtendSmash rl r1) => ExtendSmash (Cons l (FProxy f) rl) r
#ComonadSmash Source
class (ExtendSmash rl r) <= ComonadSmash rl r | rl -> r where
Members
extractSmashRL :: forall a. RLProxy rl -> Smash r a -> a
Instances
ComonadSmash Nil ()
(Comonad f, IsSymbol l, RowCons l (FProxy f) r1 r, ComonadSmash rl r1) => ComonadSmash (Cons l (FProxy f) rl) r