Last active
October 21, 2021 15:16
-
-
Save jmatsushita/d785b32926f21ed23a742fbecf432988 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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