Skip to content

Instantly share code, notes, and snippets.

@fragamus
Created December 2, 2018 19:55
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 fragamus/747fd299e63477bdef71c33812c3265b to your computer and use it in GitHub Desktop.
Save fragamus/747fd299e63477bdef71c33812c3265b to your computer and use it in GitHub Desktop.
data Store s a = Store (s -> a) s deriving Functor
instance Comonad (Store s) where
extract (Store f s) = f s
duplicate (Store f s) = Store (Store f) s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment