Created
February 18, 2024 19:37
-
-
Save unktomi/1f6ca59770cb4cbca6b2e953c4b7d85d to your computer and use it in GitHub Desktop.
CoCont CoSelection
This file contains hidden or 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
{-# LANGUAGE GADTs, RankNTypes #-} | |
newtype Const a b = Const { getConst :: a } | |
newtype Ran g h a = Ran { runRan :: forall r. (a -> g r) -> h r } | |
data Lan g h a where | |
Lan :: h i -> (g i -> a) -> Lan g h a | |
type Cont r a = Ran (Const r) (Const r) a | |
type Selection r a = Ran (Const r) (Const a) a | |
type CoCont r a = Lan (Const r) (Const r) a | |
type CoSelection r a = Lan (Const r) (Const a) a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment