Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created April 17, 2018 15:33
Show Gist options
  • Save deque-blog/ceb2bb812f4f5691a23eeed123658ab5 to your computer and use it in GitHub Desktop.
Save deque-blog/ceb2bb812f4f5691a23eeed123658ab5 to your computer and use it in GitHub Desktop.
newtype RequestCache req =
RequestCache (forall a. HashMap (req a) (MVar a))
emptyCache :: RequestCache req
lookupCache :: IRequest req a => req a -> RequestCache req -> Maybe (MVar a)
insertCache :: IRequest req a => req a -> MVar a -> RequestCache req -> RequestCache req
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment