Created
April 25, 2019 13:44
-
-
Save dmwit/a0f01d50518113f8e1c6a6088f3270f0 to your computer and use it in GitHub Desktop.
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 | |
Rank2Types, | |
GADTs, | |
DataKinds, | |
PolyKinds, | |
TypeFamilies, | |
DatatypeContexts, | |
MultiParamTypeClasses, | |
UndecidableInstances, | |
UndecidableSuperClasses | |
#-} | |
import Data.Kind | |
import GHC.Exts | |
data Stream s a = Stream (a,s) | |
data Linear s a = Linear (a,s) | End a | |
data Stack s a = Stack (a,s) | Empty | |
data Basecase s a where | |
Stream' :: Stream s a -> Basecase s a | |
Linear' :: Linear s a -> Basecase s a | |
Stack' :: Stack s a -> Basecase s a | |
data Proxy k = Proxy | |
type State s a = s -> Basecase s a | |
type CoState s a = Basecase s a -> s | |
class Get f where | |
get :: CoState (f a) a | |
class Set f where | |
set :: State (f a) a | |
data (Get f,Set f) => Zipper f a = Zipper [a] (f a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment