LiftC1 :: (k1 -> k2 -> Constraint) -> (k -> k1) -> (k -> k2) -> (k -> Constraint)
Lift1 :: (k1 -> k2 -> Type) -> (k -> k1) -> (k -> k2) -> (k -> Type)
LiftC2 :: (k1 -> k2 -> k' -> Constraint) -> (k -> k1) -> (k -> k2) -> (k -> k' -> Constraint)
Lift2 :: (k1 -> k2 -> k' -> Type) -> (k -> k1) -> (k -> k2) -> (k -> k' -> Type)
{-# Language PatternSynonyms #-}
{-# Language ViewPatterns #-}
data DMonad m = DMonad
(forall a. a -> m a)
(forall a b. m a -> (a -> m b) -> m b)
(forall a. String -> m a)
pattern Open :: (forall a. a -> [a]) -> (forall a a'. [a] -> (a -> [a']) -> [a']) -> (forall a. String -> [a]) -> xxx
https://www.ludd.ltu.se/~vk/pics/ascii/junkyard/techstuff/tutorials/Joan_Stark.html
·····┌────>
·····│▓▓░
┌────┘▓▓▓
│▓░░░░▓▓▓
│▓░░░▓▓▓▓
─┘▓░░▓▓▓▓▓
▓▓░▓▓▓▓▓▓
https://hal.archives-ouvertes.fr/hal-01571133/file/ArchipoffJanin.pdf (Unified Media Programming: An Algebraic Approach)
{-# LANGUAGE StaticPointers #-} | |
{-# LANGUAGE InstanceSigs #-} | |
{-# LANGUAGE ExistentialQuantification #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Data.Binary | |
import Data.Typeable | |
import System.IO.Unsafe | |
import GHC.StaticPtr |
This would be sweet to have:
instance Category cat => Monoid (Join cat a) where
mempty = Join id
Join f `mappend` Join g = Join (f . g)
and where we can define
You can build categories just by connecting objects with arrows. You can imagine starting with any directed graph and making it into a category by simply adding more arrows. First, add an identity arrow at each node. Then, for any two arrows such that the end of one coincides with the beginning of the other (in other words, any two composable arrows), add a new arrow to serve as their composition. Every time you add a new arrow, you have to also consider its composition with any other arrow (except for the identity arrows) and itself. You usually end up with infinitely many arrows, but that’s okay.
Another way of looking at this process is that you’re creating a category, which has an object for every node in the graph, and all possible chains of composable graph edges as morphisms. (You may even consider identity morphisms as special cases of chains of length zero.)
Such a category is called a free category generated by a given graph. It’s an example of a free construction, a proces