Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed prism test

  • Loading branch information...
commit 50954632db5214ce0f931b9aa907a97ea2326de5 1 parent a3370ef
@ekmett authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/Control/Lens/Type.hs
View
5 src/Control/Lens/Type.hs
@@ -55,6 +55,11 @@ import Data.Profunctor
-- >>> let h :: Expr -> Expr -> Expr; h = Debug.SimpleReflect.Vars.h
-- >>> let getter :: Expr -> Expr; getter = fun "getter"
-- >>> let setter :: Expr -> Expr -> Expr; setter = fun "setter"
+-- >>> import Numeric.Natural
+-- >>> :set -XFlexibleContexts
+-- >>> let nat :: Simple Prism Integer Natural; nat = prism toInteger $ \i -> if i <= 0 then Left i else Right (fromInteger i)
+-- >>> let isLeft (Left _) = True; isLeft _ = False
+-- >>> let isRight (Right _) = True; isRight _ = False
-------------------------------------------------------------------------------
-- Lenses
Please sign in to comment.
Something went wrong with that request. Please try again.