Skip to content

Instantly share code, notes, and snippets.

@mbrcknl
Created December 18, 2014 12:14
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 mbrcknl/1855ba8e07b53b93f70c to your computer and use it in GitHub Desktop.
Save mbrcknl/1855ba8e07b53b93f70c to your computer and use it in GitHub Desktop.
{-# LANGUAGE RankNTypes #-}
import Control.Lens.Lens (Lens,lens)
type Quotient s t a = forall b. Lens s t a b
quotient :: (s -> a) -> (s -> t) -> Quotient s t a
quotient sa st = lens sa (const . st)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment