Skip to content

Instantly share code, notes, and snippets.

@jmatsushita
Last active October 21, 2021 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmatsushita/d785b32926f21ed23a742fbecf432988 to your computer and use it in GitHub Desktop.
Save jmatsushita/d785b32926f21ed23a742fbecf432988 to your computer and use it in GitHub Desktop.
module Main where
import Prelude
-- Trying to implement https://github.com/dorchard/effect-monad/blob/master/src/Control/Coeffect.hs
class CoEffect :: forall k. (k -> Type -> Type) -> ((k -> Type -> Type) -> k) -> ((k -> Type -> Type) -> k -> k -> k) -> Constraint
class CoEffect
-- class Coeffect (c :: k -> * -> *) where
c
-- type Unit c :: k
unit
-- type Plus c (s :: k) (t :: k) :: k
plus
| c -> unit plus where
-- extract :: c (Unit c) a -> a
extract :: forall (a :: Type). c (unit c) a -> a
-- extend :: forall a b s t k. (c (t :: k) a -> b) -> c ((plus c s t) :: k) a -> c s b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment