Skip to content
Browse files

destroyed affine traversals. kept relevant traversals

  • Loading branch information...
1 parent 2fe687c commit 6722e4366af92bd7dd952692182e7cd62e77cc0b @ekmett committed
View
85 src/Control/Exception/Lens.hs
@@ -105,7 +105,6 @@ import Control.Exception as Exception hiding (try, tryJust, catchJust)
import Control.Lens
import Control.Lens.Internal.Exception
import Data.Monoid
-import Data.Pointed
import GHC.Conc (ThreadId)
import Prelude
( asTypeOf, const, either, flip, id, maybe, undefined
@@ -358,7 +357,7 @@ instance AsIOException p f IOException where
_IOException = id
{-# INLINE _IOException #-}
-instance (Choice p, Pointed f, Functor f) => AsIOException p f SomeException where
+instance (Choice p, Applicative f) => AsIOException p f SomeException where
_IOException = exception
{-# INLINE _IOException #-}
@@ -376,7 +375,7 @@ instance AsArithException p f ArithException where
_ArithException = id
{-# INLINE _ArithException #-}
-instance (Choice p, Pointed f, Functor f) => AsArithException p f SomeException where
+instance (Choice p, Applicative f) => AsArithException p f SomeException where
_ArithException = exception
{-# INLINE _ArithException #-}
@@ -390,10 +389,10 @@ instance (Choice p, Pointed f, Functor f) => AsArithException p f SomeException
-- '_Overflow' :: 'Prism'' 'ArithException' 'ArithException'
-- '_Overflow' :: 'Prism'' 'SomeException' 'ArithException'
-- @
-_Overflow :: (AsArithException p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t ()
+_Overflow :: (AsArithException p f t, Choice p, Applicative f) => Overloaded' p f t ()
_Overflow = _ArithException . dimap seta (either id id) . right' . rmap (Overflow <$) where
seta Overflow = Right ()
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _Overflow #-}
-- | Handle arithmetic '_Underflow'.
@@ -406,10 +405,10 @@ _Overflow = _ArithException . dimap seta (either id id) . right' . rmap (Overflo
-- '_Underflow' :: 'Prism'' 'ArithException' 'ArithException'
-- '_Underflow' :: 'Prism'' 'SomeException' 'ArithException'
-- @
-_Underflow :: (AsArithException p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t ()
+_Underflow :: (AsArithException p f t, Choice p, Applicative f) => Overloaded' p f t ()
_Underflow = _ArithException . dimap seta (either id id) . right' . rmap (Underflow <$) where
seta Underflow = Right ()
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _Underflow #-}
-- | Handle arithmetic loss of precision.
@@ -422,10 +421,10 @@ _Underflow = _ArithException . dimap seta (either id id) . right' . rmap (Underf
-- '_LossOfPrecision' :: 'Prism'' 'ArithException' 'ArithException'
-- '_LossOfPrecision' :: 'Prism'' 'SomeException' 'ArithException'
-- @
-_LossOfPrecision :: (AsArithException p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t ()
+_LossOfPrecision :: (AsArithException p f t, Choice p, Applicative f) => Overloaded' p f t ()
_LossOfPrecision = _ArithException . dimap seta (either id id) . right' . rmap (LossOfPrecision <$) where
seta LossOfPrecision = Right ()
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _LossOfPrecision #-}
-- | Handle division by zero.
@@ -438,13 +437,13 @@ _LossOfPrecision = _ArithException . dimap seta (either id id) . right' . rmap (
-- '_DivideByZero' :: 'Prism'' 'ArithException' 'ArithException'
-- '_DivideByZero' :: 'Prism'' 'SomeException' 'ArithException'
-- @
-_DivideByZero :: (AsArithException p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t ()
+_DivideByZero :: (AsArithException p f t, Choice p, Applicative f) => Overloaded' p f t ()
_DivideByZero = _ArithException . dimap seta (either id id) . right' . rmap (DivideByZero <$) where
seta DivideByZero = Right ()
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _DivideByZero #-}
--- | Handle exceptional _Denormalized floating point.
+-- | Handle exceptional _Denormalized floating pure.
--
-- @
-- '_Denormal' ≡ '_ArithException' '.' '_Denormal'
@@ -454,10 +453,10 @@ _DivideByZero = _ArithException . dimap seta (either id id) . right' . rmap (Div
-- '_Denormal' :: 'Prism'' 'ArithException' 'ArithException'
-- '_Denormal' :: 'Prism'' 'SomeException' 'ArithException'
-- @
-_Denormal :: (AsArithException p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t ()
+_Denormal :: (AsArithException p f t, Choice p, Applicative f) => Overloaded' p f t ()
_Denormal = _ArithException . dimap seta (either id id) . right' . rmap (Denormal <$) where
seta Denormal = Right ()
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _Denormal #-}
#if MIN_VERSION_base(4,6,0)
@@ -473,10 +472,10 @@ _Denormal = _ArithException . dimap seta (either id id) . right' . rmap (Denorma
-- '_RatioZeroDenominator' :: 'Prism'' 'ArithException' 'ArithException'
-- '_RatioZeroDenominator' :: 'Prism'' 'SomeException' 'ArithException'
-- @
-_RatioZeroDenominator :: (AsArithException p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t ()
+_RatioZeroDenominator :: (AsArithException p f t, Choice p, Applicative f) => Overloaded' p f t ()
_RatioZeroDenominator = _ArithException . dimap seta (either id id) . right' . rmap (RatioZeroDenominator <$) where
seta RatioZeroDenominator = Right ()
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _RatioZeroDenominator #-}
#endif
@@ -499,7 +498,7 @@ instance AsArrayException p f ArrayException where
_ArrayException = id
{-# INLINE _ArrayException #-}
-instance (Choice p, Pointed f, Functor f) => AsArrayException p f SomeException where
+instance (Choice p, Applicative f) => AsArrayException p f SomeException where
_ArrayException = exception
{-# INLINE _ArrayException #-}
@@ -513,10 +512,10 @@ instance (Choice p, Pointed f, Functor f) => AsArrayException p f SomeException
-- '_IndexOutOfBounds' :: 'Prism'' 'ArrayException' 'String'
-- '_IndexOutOfBounds' :: 'Prism'' 'SomeException' 'String'
-- @
-_IndexOutOfBounds :: (AsArrayException p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t String
+_IndexOutOfBounds :: (AsArrayException p f t, Choice p, Applicative f) => Overloaded' p f t String
_IndexOutOfBounds = _ArrayException . dimap seta (either id id) . right' . rmap (fmap IndexOutOfBounds) where
seta (IndexOutOfBounds r) = Right r
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _IndexOutOfBounds #-}
-- | An attempt was made to evaluate an element of an array that had not been initialized.
@@ -529,10 +528,10 @@ _IndexOutOfBounds = _ArrayException . dimap seta (either id id) . right' . rmap
-- '_UndefinedElement' :: 'Prism'' 'ArrayException' 'String'
-- '_UndefinedElement' :: 'Prism'' 'SomeException' 'String'
-- @
-_UndefinedElement :: (AsArrayException p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t String
+_UndefinedElement :: (AsArrayException p f t, Choice p, Applicative f) => Overloaded' p f t String
_UndefinedElement = _ArrayException . dimap seta (either id id) . right' . rmap (fmap UndefinedElement) where
seta (UndefinedElement r) = Right r
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _UndefinedElement #-}
----------------------------------------------------------------------------
@@ -556,7 +555,7 @@ instance (Profunctor p, Functor f) => AsAssertionFailed p f AssertionFailed wher
_AssertionFailed = unwrapping AssertionFailed
{-# INLINE _AssertionFailed #-}
-instance (Choice p, Pointed f, Functor f) => AsAssertionFailed p f SomeException where
+instance (Choice p, Applicative f) => AsAssertionFailed p f SomeException where
_AssertionFailed = exception.unwrapping AssertionFailed
{-# INLINE _AssertionFailed #-}
@@ -578,7 +577,7 @@ instance AsAsyncException p f AsyncException where
_AsyncException = id
{-# INLINE _AsyncException #-}
-instance (Choice p, Pointed f, Functor f) => AsAsyncException p f SomeException where
+instance (Choice p, Applicative f) => AsAsyncException p f SomeException where
_AsyncException = exception
{-# INLINE _AsyncException #-}
@@ -590,10 +589,10 @@ instance (Choice p, Pointed f, Functor f) => AsAsyncException p f SomeException
-- '_StackOverflow' :: 'Prism'' 'AsyncException' ()
-- '_StackOverflow' :: 'Prism'' 'SomeException' ()
-- @
-_StackOverflow :: (AsAsyncException p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t ()
+_StackOverflow :: (AsAsyncException p f t, Choice p, Applicative f) => Overloaded' p f t ()
_StackOverflow = _AsyncException . dimap seta (either id id) . right' . rmap (StackOverflow <$) where
seta StackOverflow = Right ()
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _StackOverflow #-}
-- | The program's heap is reaching its limit, and the program should take action
@@ -609,10 +608,10 @@ _StackOverflow = _AsyncException . dimap seta (either id id) . right' . rmap (St
-- '_HeapOverflow' :: 'Prism'' 'AsyncException' ()
-- '_HeapOverflow' :: 'Prism'' 'SomeException' ()
-- @
-_HeapOverflow :: (AsAsyncException p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t ()
+_HeapOverflow :: (AsAsyncException p f t, Choice p, Applicative f) => Overloaded' p f t ()
_HeapOverflow = _AsyncException . dimap seta (either id id) . right' . rmap (HeapOverflow <$) where
seta HeapOverflow = Right ()
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _HeapOverflow #-}
-- | This 'Exception' is raised by another thread calling
@@ -623,10 +622,10 @@ _HeapOverflow = _AsyncException . dimap seta (either id id) . right' . rmap (Hea
-- '_ThreadKilled' :: 'Prism'' 'AsyncException' ()
-- '_ThreadKilled' :: 'Prism'' 'SomeException' ()
-- @
-_ThreadKilled :: (AsAsyncException p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t ()
+_ThreadKilled :: (AsAsyncException p f t, Choice p, Applicative f) => Overloaded' p f t ()
_ThreadKilled = _AsyncException . dimap seta (either id id) . right' . rmap (ThreadKilled <$) where
seta ThreadKilled = Right ()
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _ThreadKilled #-}
-- | This 'Exception' is raised by default in the main thread of the program when
@@ -637,10 +636,10 @@ _ThreadKilled = _AsyncException . dimap seta (either id id) . right' . rmap (Thr
-- '_UserInterrupt' :: 'Prism'' 'AsyncException' ()
-- '_UserInterrupt' :: 'Prism'' 'SomeException' ()
-- @
-_UserInterrupt :: (AsAsyncException p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t ()
+_UserInterrupt :: (AsAsyncException p f t, Choice p, Applicative f) => Overloaded' p f t ()
_UserInterrupt = _AsyncException . dimap seta (either id id) . right' . rmap (UserInterrupt <$) where
seta UserInterrupt = Right ()
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _UserInterrupt #-}
----------------------------------------------------------------------------
@@ -663,7 +662,7 @@ instance (Profunctor p, Functor f) => AsNonTermination p f NonTermination where
_NonTermination = trivial NonTermination
{-# INLINE _NonTermination #-}
-instance (Choice p, Pointed f, Functor f) => AsNonTermination p f SomeException where
+instance (Choice p, Applicative f) => AsNonTermination p f SomeException where
_NonTermination = exception.trivial NonTermination
{-# INLINE _NonTermination #-}
@@ -686,7 +685,7 @@ instance (Profunctor p, Functor f) => AsNestedAtomically p f NestedAtomically wh
_NestedAtomically = trivial NestedAtomically
{-# INLINE _NestedAtomically #-}
-instance (Choice p, Pointed f, Functor f) => AsNestedAtomically p f SomeException where
+instance (Choice p, Applicative f) => AsNestedAtomically p f SomeException where
_NestedAtomically = exception.trivial NestedAtomically
{-# INLINE _NestedAtomically #-}
@@ -710,7 +709,7 @@ instance (Profunctor p, Functor f) => AsBlockedIndefinitelyOnMVar p f BlockedInd
_BlockedIndefinitelyOnMVar = trivial BlockedIndefinitelyOnMVar
{-# INLINE _BlockedIndefinitelyOnMVar #-}
-instance (Choice p, Pointed f, Functor f) => AsBlockedIndefinitelyOnMVar p f SomeException where
+instance (Choice p, Applicative f) => AsBlockedIndefinitelyOnMVar p f SomeException where
_BlockedIndefinitelyOnMVar = exception.trivial BlockedIndefinitelyOnMVar
{-# INLINE _BlockedIndefinitelyOnMVar #-}
@@ -734,7 +733,7 @@ instance (Profunctor p, Functor f) => AsBlockedIndefinitelyOnSTM p f BlockedInde
_BlockedIndefinitelyOnSTM = trivial BlockedIndefinitelyOnSTM
{-# INLINE _BlockedIndefinitelyOnSTM #-}
-instance (Choice p, Pointed f, Functor f) => AsBlockedIndefinitelyOnSTM p f SomeException where
+instance (Choice p, Applicative f) => AsBlockedIndefinitelyOnSTM p f SomeException where
_BlockedIndefinitelyOnSTM = exception.trivial BlockedIndefinitelyOnSTM
{-# INLINE _BlockedIndefinitelyOnSTM #-}
@@ -757,7 +756,7 @@ instance (Profunctor p, Functor f) => AsDeadlock p f Deadlock where
_Deadlock = trivial Deadlock
{-# INLINE _Deadlock #-}
-instance (Choice p, Pointed f, Functor f) => AsDeadlock p f SomeException where
+instance (Choice p, Applicative f) => AsDeadlock p f SomeException where
_Deadlock = exception.trivial Deadlock
{-# INLINE _Deadlock #-}
@@ -780,7 +779,7 @@ instance (Profunctor p, Functor f) => AsNoMethodError p f NoMethodError where
_NoMethodError = unwrapping NoMethodError
{-# INLINE _NoMethodError #-}
-instance (Choice p, Pointed f, Functor f) => AsNoMethodError p f SomeException where
+instance (Choice p, Applicative f) => AsNoMethodError p f SomeException where
_NoMethodError = exception.unwrapping NoMethodError
{-# INLINE _NoMethodError #-}
@@ -802,7 +801,7 @@ instance (Profunctor p, Functor f) => AsPatternMatchFail p f PatternMatchFail wh
_PatternMatchFail = unwrapping PatternMatchFail
{-# INLINE _PatternMatchFail #-}
-instance (Choice p, Pointed f, Functor f) => AsPatternMatchFail p f SomeException where
+instance (Choice p, Applicative f) => AsPatternMatchFail p f SomeException where
_PatternMatchFail = exception.unwrapping PatternMatchFail
{-# INLINE _PatternMatchFail #-}
@@ -825,7 +824,7 @@ instance (Profunctor p, Functor f) => AsRecConError p f RecConError where
_RecConError = unwrapping RecConError
{-# INLINE _RecConError #-}
-instance (Choice p, Pointed f, Functor f) => AsRecConError p f SomeException where
+instance (Choice p, Applicative f) => AsRecConError p f SomeException where
_RecConError = exception.unwrapping RecConError
{-# INLINE _RecConError #-}
@@ -844,7 +843,7 @@ instance (Profunctor p, Functor f) => AsRecSelError p f RecSelError where
_RecSelError = unwrapping RecSelError
{-# INLINE _RecSelError #-}
-instance (Choice p, Pointed f, Functor f) => AsRecSelError p f SomeException where
+instance (Choice p, Applicative f) => AsRecSelError p f SomeException where
_RecSelError = exception.unwrapping RecSelError
{-# INLINE _RecSelError #-}
@@ -863,7 +862,7 @@ instance (Profunctor p, Functor f) => AsRecUpdError p f RecUpdError where
_RecUpdError = unwrapping RecUpdError
{-# INLINE _RecUpdError #-}
-instance (Choice p, Pointed f, Functor f) => AsRecUpdError p f SomeException where
+instance (Choice p, Applicative f) => AsRecUpdError p f SomeException where
_RecUpdError = exception.unwrapping RecUpdError
{-# INLINE _RecUpdError #-}
@@ -885,7 +884,7 @@ instance (Profunctor p, Functor f) => AsErrorCall p f ErrorCall where
_ErrorCall = unwrapping ErrorCall
{-# INLINE _ErrorCall #-}
-instance (Choice p, Pointed f, Functor f) => AsErrorCall p f SomeException where
+instance (Choice p, Applicative f) => AsErrorCall p f SomeException where
_ErrorCall = exception.unwrapping ErrorCall
{-# INLINE _ErrorCall #-}
@@ -908,7 +907,7 @@ instance (Profunctor p, Functor f) => AsHandlingException p f HandlingException
_HandlingException = trivial HandlingException
{-# INLINE _HandlingException #-}
-instance (Choice p, Pointed f, Functor f) => AsHandlingException p f SomeException where
+instance (Choice p, Applicative f) => AsHandlingException p f SomeException where
_HandlingException = exception.trivial HandlingException
{-# INLINE _HandlingException #-}
View
56 src/Control/Lens/At.hs
@@ -63,12 +63,12 @@ import Data.IntSet as IntSet
import Data.List.NonEmpty as NonEmpty
import Data.Map as Map
import Data.Maybe
-import Data.Pointed
import Data.Proxy
import Data.Set as Set
import Data.Sequence as Seq
import Data.Text as StrictT
import Data.Text.Lazy as LazyT
+import Data.Traversable
import Data.Tree
import Data.Vector as Vector hiding (indexed)
import Data.Vector.Primitive as Prim
@@ -368,37 +368,37 @@ class Ixed m where
--
-- >>> Seq.fromList [] ^? ix 2
-- Nothing
- ix :: Index m -> AffineTraversal' m (IxValue m)
+ ix :: Index m -> Traversal' m (IxValue m)
#ifdef DEFAULT_SIGNATURES
- default ix :: (Pointed f, Functor f, At m) => Index m -> LensLike' f m (IxValue m)
+ default ix :: (Applicative f, At m) => Index m -> LensLike' f m (IxValue m)
ix = ixAt
{-# INLINE ix #-}
#endif
-- | A definition of 'ix' for types with an 'At' instance. This is the default
-- if you don't specify a definition for 'ix'.
-ixAt :: At m => Index m -> AffineTraversal' m (IxValue m)
-ixAt i = at i . just where just f = maybe (point Nothing) (fmap Just . f)
+ixAt :: At m => Index m -> Traversal' m (IxValue m)
+ixAt i = at i . traverse
{-# INLINE ixAt #-}
type instance IxValue (Maybe a) = a
instance Ixed (Maybe a) where
ix () f (Just a) = Just <$> f a
- ix () _ Nothing = point Nothing
+ ix () _ Nothing = pure Nothing
{-# INLINE ix #-}
type instance IxValue [a] = a
instance Ixed [a] where
- ix k f xs0 | k < 0 = point xs0
+ ix k f xs0 | k < 0 = pure xs0
| otherwise = go xs0 k where
- go [] _ = point []
+ go [] _ = pure []
go (a:as) 0 = f a <&> (:as)
go (a:as) i = (a:) <$> (go as $! i - 1)
{-# INLINE ix #-}
type instance IxValue (NonEmpty a) = a
instance Ixed (NonEmpty a) where
- ix k f xs0 | k < 0 = point xs0
+ ix k f xs0 | k < 0 = pure xs0
| otherwise = go xs0 k where
go (a:|as) 0 = f a <&> (:|as)
go (a:|as) i = (a:|) <$> ix (i - 1) f as
@@ -413,60 +413,60 @@ type instance IxValue (Tree a) = a
instance Ixed (Tree a) where
ix xs0 f = go xs0 where
go [] (Node a as) = f a <&> \a' -> Node a' as
- go (i:is) t@(Node a as) | i < 0 = point t
+ go (i:is) t@(Node a as) | i < 0 = pure t
| otherwise = Node a <$> goto is as i
goto is (a:as) 0 = go is a <&> (:as)
goto is (_:as) n = goto is as $! n - 1
- goto _ [] _ = point []
+ goto _ [] _ = pure []
{-# INLINE ix #-}
type instance IxValue (Seq a) = a
instance Ixed (Seq a) where
ix i f m
| 0 <= i && i < Seq.length m = f (Seq.index m i) <&> \a -> Seq.update i a m
- | otherwise = point m
+ | otherwise = pure m
{-# INLINE ix #-}
type instance IxValue (IntMap a) = a
instance Ixed (IntMap a) where
ix k f m = case IntMap.lookup k m of
Just v -> f v <&> \v' -> IntMap.insert k v' m
- Nothing -> point m
+ Nothing -> pure m
{-# INLINE ix #-}
type instance IxValue (Map k a) = a
instance Ord k => Ixed (Map k a) where
ix k f m = case Map.lookup k m of
Just v -> f v <&> \v' -> Map.insert k v' m
- Nothing -> point m
+ Nothing -> pure m
{-# INLINE ix #-}
type instance IxValue (HashMap k a) = a
instance (Eq k, Hashable k) => Ixed (HashMap k a) where
ix k f m = case HashMap.lookup k m of
Just v -> f v <&> \v' -> HashMap.insert k v' m
- Nothing -> point m
+ Nothing -> pure m
{-# INLINE ix #-}
type instance IxValue (Set k) = ()
instance Ord k => Ixed (Set k) where
ix k f m = if Set.member k m
then f () <&> \() -> Set.insert k m
- else point m
+ else pure m
{-# INLINE ix #-}
type instance IxValue IntSet = ()
instance Ixed IntSet where
ix k f m = if IntSet.member k m
then f () <&> \() -> IntSet.insert k m
- else point m
+ else pure m
{-# INLINE ix #-}
type instance IxValue (HashSet k) = ()
instance (Eq k, Hashable k) => Ixed (HashSet k) where
ix k f m = if HashSet.member k m
then f () <&> \() -> HashSet.insert k m
- else point m
+ else pure m
{-# INLINE ix #-}
type instance IxValue (Array i e) = e
@@ -478,7 +478,7 @@ type instance IxValue (Array i e) = e
instance Ix i => Ixed (Array i e) where
ix i f arr
| inRange (bounds arr) i = f (arr Array.! i) <&> \e -> arr Array.// [(i,e)]
- | otherwise = point arr
+ | otherwise = pure arr
{-# INLINE ix #-}
type instance IxValue (UArray i e) = e
@@ -490,42 +490,42 @@ type instance IxValue (UArray i e) = e
instance (IArray UArray e, Ix i) => Ixed (UArray i e) where
ix i f arr
| inRange (bounds arr) i = f (arr Array.! i) <&> \e -> arr Array.// [(i,e)]
- | otherwise = point arr
+ | otherwise = pure arr
{-# INLINE ix #-}
type instance IxValue (Vector.Vector a) = a
instance Ixed (Vector.Vector a) where
ix i f v
| 0 <= i && i < Vector.length v = f (v Vector.! i) <&> \a -> v Vector.// [(i, a)]
- | otherwise = point v
+ | otherwise = pure v
{-# INLINE ix #-}
type instance IxValue (Prim.Vector a) = a
instance Prim a => Ixed (Prim.Vector a) where
ix i f v
| 0 <= i && i < Prim.length v = f (v Prim.! i) <&> \a -> v Prim.// [(i, a)]
- | otherwise = point v
+ | otherwise = pure v
{-# INLINE ix #-}
type instance IxValue (Storable.Vector a) = a
instance Storable a => Ixed (Storable.Vector a) where
ix i f v
| 0 <= i && i < Storable.length v = f (v Storable.! i) <&> \a -> v Storable.// [(i, a)]
- | otherwise = point v
+ | otherwise = pure v
{-# INLINE ix #-}
type instance IxValue (Unboxed.Vector a) = a
instance Unbox a => Ixed (Unboxed.Vector a) where
ix i f v
| 0 <= i && i < Unboxed.length v = f (v Unboxed.! i) <&> \a -> v Unboxed.// [(i, a)]
- | otherwise = point v
+ | otherwise = pure v
{-# INLINE ix #-}
type instance IxValue StrictT.Text = Char
instance Ixed StrictT.Text where
ix e f s = case StrictT.splitAt e s of
(l, mr) -> case StrictT.uncons mr of
- Nothing -> point s
+ Nothing -> pure s
Just (c, xs) -> f c <&> \d -> StrictT.concat [l, StrictT.singleton d, xs]
{-# INLINE ix #-}
@@ -533,7 +533,7 @@ type instance IxValue LazyT.Text = Char
instance Ixed LazyT.Text where
ix e f s = case LazyT.splitAt e s of
(l, mr) -> case LazyT.uncons mr of
- Nothing -> point s
+ Nothing -> pure s
Just (c, xs) -> f c <&> \d -> LazyT.append l (LazyT.cons d xs)
{-# INLINE ix #-}
@@ -541,7 +541,7 @@ type instance IxValue StrictB.ByteString = Word8
instance Ixed StrictB.ByteString where
ix e f s = case StrictB.splitAt e s of
(l, mr) -> case StrictB.uncons mr of
- Nothing -> point s
+ Nothing -> pure s
Just (c, xs) -> f c <&> \d -> StrictB.concat [l, StrictB.singleton d, xs]
{-# INLINE ix #-}
@@ -550,7 +550,7 @@ instance Ixed LazyB.ByteString where
-- TODO: we could be lazier, returning each chunk as it is passed
ix e f s = case LazyB.splitAt e s of
(l, mr) -> case LazyB.uncons mr of
- Nothing -> point s
+ Nothing -> pure s
Just (c, xs) -> f c <&> \d -> LazyB.append l (LazyB.cons d xs)
{-# INLINE ix #-}
View
41 src/Control/Lens/Cons.hs
@@ -43,7 +43,6 @@ import qualified Data.ByteString as StrictB
import qualified Data.ByteString.Lazy as LazyB
import Data.Functor.Identity
import Data.Monoid
-import Data.Pointed
import Data.Profunctor
import qualified Data.Sequence as Seq
import Data.Sequence hiding ((<|), (|>))
@@ -95,56 +94,56 @@ class (Profunctor p, Functor f) => Cons p f s t a b | s -> a, t -> b, s b -> t,
-- or which only permit 'cons', or where '_head' and '_tail' are lenses and not traversals.
_Cons :: Overloaded p f s t (a,s) (b,t)
-instance (Choice p, Pointed f, Functor f) => Cons p f [a] [b] a b where
+instance (Choice p, Applicative f) => Cons p f [a] [b] a b where
_Cons = prism (uncurry (:)) $ \ aas -> case aas of
(a:as) -> Right (a, as)
[] -> Left []
{-# INLINE _Cons #-}
-instance (Choice p, Pointed f, Functor f) => Cons p f (Seq a) (Seq b) a b where
+instance (Choice p, Applicative f) => Cons p f (Seq a) (Seq b) a b where
_Cons = prism (uncurry (Seq.<|)) $ \aas -> case viewl aas of
a :< as -> Right (a, as)
EmptyL -> Left mempty
{-# INLINE _Cons #-}
-instance (Choice p, Pointed f, Functor f) => Cons p f StrictB.ByteString StrictB.ByteString Word8 Word8 where
+instance (Choice p, Applicative f) => Cons p f StrictB.ByteString StrictB.ByteString Word8 Word8 where
_Cons = prism' (uncurry StrictB.cons) StrictB.uncons
{-# INLINE _Cons #-}
-instance (Choice p, Pointed f, Functor f) => Cons p f LazyB.ByteString LazyB.ByteString Word8 Word8 where
+instance (Choice p, Applicative f) => Cons p f LazyB.ByteString LazyB.ByteString Word8 Word8 where
_Cons = prism' (uncurry LazyB.cons) LazyB.uncons
{-# INLINE _Cons #-}
-instance (Choice p, Pointed f, Functor f) => Cons p f StrictT.Text StrictT.Text Char Char where
+instance (Choice p, Applicative f) => Cons p f StrictT.Text StrictT.Text Char Char where
_Cons = prism' (uncurry StrictT.cons) StrictT.uncons
{-# INLINE _Cons #-}
-instance (Choice p, Pointed f, Functor f) => Cons p f LazyT.Text LazyT.Text Char Char where
+instance (Choice p, Applicative f) => Cons p f LazyT.Text LazyT.Text Char Char where
_Cons = prism' (uncurry LazyT.cons) LazyT.uncons
{-# INLINE _Cons #-}
-instance (Choice p, Pointed f, Functor f) => Cons p f (Vector a) (Vector b) a b where
+instance (Choice p, Applicative f) => Cons p f (Vector a) (Vector b) a b where
_Cons = prism (uncurry Vector.cons) $ \v ->
if Vector.null v
then Left Vector.empty
else Right (Vector.unsafeHead v, Vector.unsafeTail v)
{-# INLINE _Cons #-}
-instance (Choice p, Pointed f, Functor f, Prim a, Prim b) => Cons p f (Prim.Vector a) (Prim.Vector b) a b where
+instance (Choice p, Applicative f, Prim a, Prim b) => Cons p f (Prim.Vector a) (Prim.Vector b) a b where
_Cons = prism (uncurry Prim.cons) $ \v ->
if Prim.null v
then Left Prim.empty
else Right (Prim.unsafeHead v, Prim.unsafeTail v)
{-# INLINE _Cons #-}
-instance (Choice p, Pointed f, Functor f, Storable a, Storable b) => Cons p f (Storable.Vector a) (Storable.Vector b) a b where
+instance (Choice p, Applicative f, Storable a, Storable b) => Cons p f (Storable.Vector a) (Storable.Vector b) a b where
_Cons = prism (uncurry Storable.cons) $ \v ->
if Storable.null v
then Left Storable.empty
else Right (Storable.unsafeHead v, Storable.unsafeTail v)
{-# INLINE _Cons #-}
-instance (Choice p, Pointed f, Functor f, Unbox a, Unbox b) => Cons p f (Unbox.Vector a) (Unbox.Vector b) a b where
+instance (Choice p, Applicative f, Unbox a, Unbox b) => Cons p f (Unbox.Vector a) (Unbox.Vector b) a b where
_Cons = prism (uncurry Unbox.cons) $ \v ->
if Unbox.null v
then Left Unbox.empty
@@ -323,61 +322,61 @@ class (Profunctor p, Functor f) => Snoc p f s t a b | s -> a, t -> b, s b -> t,
-- or which only permit 'snoc' or where '_init' and '_last' are lenses and not traversals.
_Snoc :: Overloaded p f s t (s,a) (t,b)
-instance (Choice p, Pointed f, Functor f) => Snoc p f [a] [b] a b where
+instance (Choice p, Applicative f) => Snoc p f [a] [b] a b where
_Snoc = prism (\(as,a) -> as Prelude.++ [a]) $ \aas -> if Prelude.null aas
then Left []
else Right (Prelude.init aas, Prelude.last aas)
{-# INLINE _Snoc #-}
-instance (Choice p, Pointed f, Functor f) => Snoc p f (Seq a) (Seq b) a b where
+instance (Choice p, Applicative f) => Snoc p f (Seq a) (Seq b) a b where
_Snoc = prism (uncurry (Seq.|>)) $ \aas -> case viewr aas of
as :> a -> Right (as, a)
EmptyR -> Left mempty
{-# INLINE _Snoc #-}
-instance (Choice p, Pointed f, Functor f) => Snoc p f (Vector a) (Vector b) a b where
+instance (Choice p, Applicative f) => Snoc p f (Vector a) (Vector b) a b where
_Snoc = prism (uncurry Vector.snoc) $ \v -> if Vector.null v
then Left Vector.empty
else Right (Vector.unsafeInit v, Vector.unsafeLast v)
{-# INLINE _Snoc #-}
-instance (Choice p, Pointed f, Functor f, Prim a, Prim b) => Snoc p f (Prim.Vector a) (Prim.Vector b) a b where
+instance (Choice p, Applicative f, Prim a, Prim b) => Snoc p f (Prim.Vector a) (Prim.Vector b) a b where
_Snoc = prism (uncurry Prim.snoc) $ \v -> if Prim.null v
then Left Prim.empty
else Right (Prim.unsafeInit v, Prim.unsafeLast v)
{-# INLINE _Snoc #-}
-instance (Choice p, Pointed f, Functor f, Storable a, Storable b) => Snoc p f (Storable.Vector a) (Storable.Vector b) a b where
+instance (Choice p, Applicative f, Storable a, Storable b) => Snoc p f (Storable.Vector a) (Storable.Vector b) a b where
_Snoc = prism (uncurry Storable.snoc) $ \v -> if Storable.null v
then Left Storable.empty
else Right (Storable.unsafeInit v, Storable.unsafeLast v)
{-# INLINE _Snoc #-}
-instance (Choice p, Pointed f, Functor f, Unbox a, Unbox b) => Snoc p f (Unbox.Vector a) (Unbox.Vector b) a b where
+instance (Choice p, Applicative f, Unbox a, Unbox b) => Snoc p f (Unbox.Vector a) (Unbox.Vector b) a b where
_Snoc = prism (uncurry Unbox.snoc) $ \v -> if Unbox.null v
then Left Unbox.empty
else Right (Unbox.unsafeInit v, Unbox.unsafeLast v)
{-# INLINE _Snoc #-}
-instance (Choice p, Pointed f, Functor f) => Snoc p f StrictB.ByteString StrictB.ByteString Word8 Word8 where
+instance (Choice p, Applicative f) => Snoc p f StrictB.ByteString StrictB.ByteString Word8 Word8 where
_Snoc = prism (uncurry StrictB.snoc) $ \v -> if StrictB.null v
then Left StrictB.empty
else Right (StrictB.init v, StrictB.last v)
{-# INLINE _Snoc #-}
-instance (Choice p, Pointed f, Functor f) => Snoc p f LazyB.ByteString LazyB.ByteString Word8 Word8 where
+instance (Choice p, Applicative f) => Snoc p f LazyB.ByteString LazyB.ByteString Word8 Word8 where
_Snoc = prism (uncurry LazyB.snoc) $ \v -> if LazyB.null v
then Left LazyB.empty
else Right (LazyB.init v, LazyB.last v)
{-# INLINE _Snoc #-}
-instance (Choice p, Pointed f, Functor f) => Snoc p f StrictT.Text StrictT.Text Char Char where
+instance (Choice p, Applicative f) => Snoc p f StrictT.Text StrictT.Text Char Char where
_Snoc = prism (uncurry StrictT.snoc) $ \v -> if StrictT.null v
then Left StrictT.empty
else Right (StrictT.init v, StrictT.last v)
{-# INLINE _Snoc #-}
-instance (Choice p, Pointed f, Functor f) => Snoc p f LazyT.Text LazyT.Text Char Char where
+instance (Choice p, Applicative f) => Snoc p f LazyT.Text LazyT.Text Char Char where
_Snoc = prism (uncurry LazyT.snoc) $ \v -> if LazyT.null v
then Left LazyT.empty
else Right (LazyT.init v, LazyT.last v)
View
5 src/Control/Lens/Internal/Deque.hs
@@ -38,7 +38,6 @@ import Data.Function
import Data.Functor.Bind
import Data.Functor.Plus
import Data.Functor.Reverse
-import Data.Pointed
import Data.Traversable as Traversable
import Data.Semigroup
import Data.Profunctor.Unsafe
@@ -187,7 +186,7 @@ check lf f lr r
| otherwise = BD lf f lr r
{-# INLINE check #-}
-instance (Choice p, Pointed f, Functor f) => Cons p f (Deque a) (Deque b) a b where
+instance (Choice p, Applicative f) => Cons p f (Deque a) (Deque b) a b where
_Cons = prism (\(x,BD lf f lr r) -> check (lf + 1) (x : f) lr r) $ \ (BD lf f lr r) ->
if lf + lr == 0
then Left empty
@@ -196,7 +195,7 @@ instance (Choice p, Pointed f, Functor f) => Cons p f (Deque a) (Deque b) a b wh
(x:xs) -> (x, check (lf - 1) xs lr r)
{-# INLINE _Cons #-}
-instance (Choice p, Pointed f, Functor f) => Snoc p f (Deque a) (Deque b) a b where
+instance (Choice p, Applicative f) => Snoc p f (Deque a) (Deque b) a b where
_Snoc = prism (\(BD lf f lr r,x) -> check lf f (lr + 1) (x : r)) $ \ (BD lf f lr r) ->
if lf + lr == 0
then Left empty
View
4 src/Control/Lens/Prism.hs
@@ -41,13 +41,13 @@ module Control.Lens.Prism
, Choice(..)
) where
+import Control.Applicative
import Control.Lens.Combinators
import Control.Lens.Internal.Prism
import Control.Lens.Review
import Control.Lens.Type
import Control.Monad
import Data.Functor.Identity
-import Data.Pointed
import Data.Profunctor
import Data.Void
#ifndef SAFE
@@ -108,7 +108,7 @@ clonePrism k = case runPrism k of
-- @'Either' t a@ is used instead of @'Maybe' a@ to permit the types of @s@ and @t@ to differ.
--
prism :: (b -> t) -> (s -> Either t a) -> Prism s t a b
-prism bt seta = dimap seta (either point (fmap bt)) . right'
+prism bt seta = dimap seta (either pure (fmap bt)) . right'
{-# INLINE prism #-}
-- | This is usually used to build a 'Prism'', when you have to use an operation like
View
39 src/Control/Lens/Type.hs
@@ -28,33 +28,29 @@ module Control.Lens.Type
-- * Lenses, Folds and Traversals
, Lens, Lens'
, Traversal, Traversal'
- , AffineTraversal, AffineTraversal'
, RelevantTraversal, RelevantTraversal'
, Setter, Setter'
, Getter, Fold
- , AffineFold, RelevantFold
- , Action, MonadicFold
- , AffineMonadicFold, RelevantMonadicFold
+ , RelevantFold
+ , Action, MonadicFold, RelevantMonadicFold
-- * Indexed
, IndexedLens, IndexedLens'
, IndexedTraversal, IndexedTraversal'
- , IndexedAffineTraversal, IndexedAffineTraversal'
, IndexedRelevantTraversal, IndexedRelevantTraversal'
, IndexedSetter, IndexedSetter'
, IndexedGetter, IndexedFold
- , IndexedAffineFold, IndexedRelevantFold
+ , IndexedRelevantFold
, IndexedAction, IndexedMonadicFold
- , IndexedAffineMonadicFold, IndexedRelevantMonadicFold
+ , IndexedRelevantMonadicFold
-- * Index-Preserving
, IndexPreservingLens, IndexPreservingLens'
, IndexPreservingTraversal, IndexPreservingTraversal'
- , IndexPreservingAffineTraversal, IndexPreservingAffineTraversal'
, IndexPreservingRelevantTraversal, IndexPreservingRelevantTraversal'
, IndexPreservingSetter, IndexPreservingSetter'
, IndexPreservingGetter, IndexPreservingFold
- , IndexPreservingAffineFold, IndexPreservingRelevantFold
+ , IndexPreservingRelevantFold
, IndexPreservingAction, IndexPreservingMonadicFold
- , IndexPreservingAffineMonadicFold, IndexPreservingRelevantMonadicFold
+ , IndexPreservingRelevantMonadicFold
-- * Common
, Simple
, LensLike, LensLike'
@@ -70,7 +66,6 @@ import Control.Lens.Internal.Setter
import Control.Lens.Internal.Indexed
import Data.Functor.Contravariant
import Data.Functor.Apply
-import Data.Pointed
import Data.Profunctor
-- $setup
@@ -197,9 +192,6 @@ type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t
-- @
type Traversal' s a = Traversal s s a a
-type AffineTraversal s t a b = forall f. (Pointed f, Functor f) => (a -> f b) -> s -> f t
-type AffineTraversal' s a = AffineTraversal s s a a
-
type RelevantTraversal s t a b = forall f. Apply f => (a -> f b) -> s -> f t
type RelevantTraversal' s a = RelevantTraversal s s a a
@@ -217,9 +209,6 @@ type IndexedTraversal i s t a b = forall p f. (Indexable i p, Applicative f) =>
-- @
type IndexedTraversal' i s a = IndexedTraversal i s s a a
-type IndexedAffineTraversal i s t a b = forall p f. (Indexable i p, Pointed f, Functor f) => p a (f b) -> s -> f t
-type IndexedAffineTraversal' i s a = IndexedAffineTraversal i s s a a
-
type IndexedRelevantTraversal i s t a b = forall p f. (Indexable i p, Apply f) => p a (f b) -> s -> f t
type IndexedRelevantTraversal' i s a = IndexedRelevantTraversal i s s a a
@@ -231,9 +220,6 @@ type IndexPreservingTraversal s t a b = forall p f. (Conjoined p, Applicative f)
-- @
type IndexPreservingTraversal' s a = IndexPreservingTraversal s s a a
-type IndexPreservingAffineTraversal s t a b = forall p f. (Conjoined p, Pointed f, Functor f) => p a (f b) -> p s (f t)
-type IndexPreservingAffineTraversal' s a = IndexPreservingAffineTraversal s s a a
-
type IndexPreservingRelevantTraversal s t a b = forall p f. (Conjoined p, Apply f) => p a (f b) -> p s (f t)
type IndexPreservingRelevantTraversal' s a = IndexPreservingRelevantTraversal s s a a
@@ -333,7 +319,7 @@ type Iso' s a = Iso s s a a
-- Prism Internals
------------------------------------------------------------------------------
--- | A 'Prism' @l@ is an 'AffineTraversal' that can also be turned
+-- | A 'Prism' @l@ is a 'Traversal' that can also be turned
-- around with 'Control.Lens.Review.re' to obtain a 'Getter' in the
-- opposite direction.
--
@@ -357,7 +343,7 @@ type Iso' s a = Iso s s a a
--
-- It may help to think of this as a 'Iso' that can be partial in one direction.
--
--- Every 'Prism' is a valid 'AffineTraversal'.
+-- Every 'Prism' is a valid 'Traversal'.
--
-- Every 'Iso' is a valid 'Prism'.
--
@@ -411,7 +397,7 @@ type Iso' s a = Iso s s a a
-- -- a co-'Lens', so to speak. This is what permits the construction of 'Control.Lens.Prism.outside'.
--
-- Note: Composition with a 'Prism' is index-preserving.
-type Prism s t a b = forall p f. (Choice p, Pointed f, Functor f) => p a (f b) -> p s (f t)
+type Prism s t a b = forall p f. (Choice p, Applicative f) => p a (f b) -> p s (f t)
-- | A 'Simple' 'Prism'.
type Prism' s a = Prism s s a a
@@ -480,10 +466,6 @@ type IndexedFold i s a = forall p f. (Indexable i p, Contravariant f, Applicati
-- 'IndexedFold', or 'IndexedLens' yields an 'IndexedFold' respectively.
type IndexPreservingFold s a = forall p f. (Conjoined p, Contravariant f, Applicative f) => p a (f a) -> p s (f s)
-type AffineFold s a = forall f. (Contravariant f, Pointed f, Functor f) => (a -> f a) -> s -> f s
-type IndexedAffineFold i s a = forall p f. (Indexable i p, Contravariant f, Pointed f, Functor f) => p a (f a) -> s -> f s
-type IndexPreservingAffineFold s a = forall p f. (Conjoined p, Contravariant f, Pointed f, Functor f) => p a (f a) -> p s (f s)
-
type RelevantFold s a = forall f. (Contravariant f, Apply f) => (a -> f a) -> s -> f s
type IndexedRelevantFold i s a = forall p f. (Indexable i p, Contravariant f, Apply f) => p a (f a) -> s -> f s
type IndexPreservingRelevantFold s a = forall p f. (Conjoined p, Contravariant f, Apply f) => p a (f a) -> p s (f s)
@@ -520,7 +502,6 @@ type IndexPreservingAction m s a = forall p f r. (Conjoined p, Effective m r f)
--
-- You can compose a 'MonadicFold' with another 'MonadicFold' using ('Prelude..') from the @Prelude@.
type MonadicFold m s a = forall f r. (Effective m r f, Applicative f) => (a -> f a) -> s -> f s
-type AffineMonadicFold m s a = forall f r. (Effective m r f, Pointed f, Functor f) => (a -> f a) -> s -> f s
type RelevantMonadicFold m s a = forall f r. (Effective m r f, Apply f) => (a -> f a) -> s -> f s
-- | An 'IndexedMonadicFold' is an 'IndexedFold' enriched with access to a 'Monad' for side-effects.
@@ -529,13 +510,11 @@ type RelevantMonadicFold m s a = forall f r. (Effective m r f, Apply f) => (a ->
--
-- You can compose an 'IndexedMonadicFold' with another 'IndexedMonadicFold' using ('Prelude..') from the @Prelude@.
type IndexedMonadicFold i m s a = forall p f r. (Indexable i p, Effective m r f, Applicative f) => p a (f a) -> s -> f s
-type IndexedAffineMonadicFold i m s a = forall p f r. (Indexable i p, Effective m r f, Pointed f, Functor f) => p a (f a) -> s -> f s
type IndexedRelevantMonadicFold i m s a = forall p f r. (Indexable i p, Effective m r f, Apply f) => p a (f a) -> s -> f s
-- | An 'IndexPreservingFold' can be used as a 'Fold', but when composed with an 'IndexedTraversal',
-- 'IndexedFold', or 'IndexedLens' yields an 'IndexedFold' respectively.
type IndexPreservingMonadicFold m s a = forall p f r. (Conjoined p, Effective m r f, Applicative f) => p a (f a) -> p s (f s)
-type IndexPreservingAffineMonadicFold m s a = forall p f r. (Conjoined p, Effective m r f, Pointed f, Functor f) => p a (f a) -> p s (f s)
type IndexPreservingRelevantMonadicFold m s a = forall p f r. (Conjoined p, Effective m r f, Apply f) => p a (f a) -> p s (f s)
-------------------------------------------------------------------------------
View
11 src/System/Exit/Lens.hs
@@ -21,7 +21,6 @@ import Control.Applicative
import Control.Exception
import Control.Exception.Lens
import Control.Lens
-import Data.Pointed
import System.Exit
-- | Exit codes that a program can return with:
@@ -37,7 +36,7 @@ instance AsExitCode p f ExitCode where
_ExitCode = id
{-# INLINE _ExitCode #-}
-instance (Choice p, Pointed f, Functor f) => AsExitCode p f SomeException where
+instance (Choice p, Applicative f) => AsExitCode p f SomeException where
_ExitCode = exception
{-# INLINE _ExitCode #-}
@@ -47,10 +46,10 @@ instance (Choice p, Pointed f, Functor f) => AsExitCode p f SomeException where
-- '_ExitSuccess' :: 'Prism'' 'ExitCode' ()
-- '_ExitSuccess' :: 'Prism'' 'SomeException' ()
-- @
-_ExitSuccess :: (AsExitCode p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t ()
+_ExitSuccess :: (AsExitCode p f t, Choice p, Applicative f) => Overloaded' p f t ()
_ExitSuccess = _ExitCode . dimap seta (either id id) . right' . rmap (ExitSuccess <$) where
seta ExitSuccess = Right ()
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _ExitSuccess #-}
-- | indicates program failure with an exit code. The exact interpretation of the code is operating-system dependent. In particular, some values may be prohibited (e.g. 0 on a POSIX-compliant system).
@@ -59,8 +58,8 @@ _ExitSuccess = _ExitCode . dimap seta (either id id) . right' . rmap (ExitSucces
-- '_ExitFailure' :: 'Prism'' 'ExitCode' 'Int'
-- '_ExitFailure' :: 'Prism'' 'SomeException' 'Int'
-- @
-_ExitFailure :: (AsExitCode p f t, Choice p, Pointed f, Functor f) => Overloaded' p f t Int
+_ExitFailure :: (AsExitCode p f t, Choice p, Applicative f) => Overloaded' p f t Int
_ExitFailure = _ExitCode . dimap seta (either id id) . right' . rmap (fmap ExitFailure) where
seta (ExitFailure i) = Right i
- seta t = Left (point t)
+ seta t = Left (pure t)
{-# INLINE _ExitFailure #-}

0 comments on commit 6722e43

Please sign in to comment.
Something went wrong with that request. Please try again.