packages feed

microlens 0.4.8.0 → 0.4.8.1

raw patch · 6 files changed

+49/−36 lines, 6 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Lens.Micro.Internal: type HasCallStack = ?callStack :: CallStack
- Lens.Micro: (^?!) :: s -> Getting (Endo a) s a -> a
+ Lens.Micro: (^?!) :: HasCallStack => s -> Getting (Endo a) s a -> a
- Lens.Micro: singular :: Traversal s t a a -> Lens s t a a
+ Lens.Micro: singular :: HasCallStack => Traversal s t a a -> Lens s t a a

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.4.8.1++* Added `HasCallStack` for some partial functions.+ # 0.4.8.0  * Added `forOf_` and `forOf`.
microlens.cabal view
@@ -1,5 +1,5 @@ name:                microlens-version:             0.4.8.0+version:             0.4.8.1 synopsis:            A tiny lens library with no dependencies. If you're writing an app, you probably want microlens-platform, not this. description:   NOTE: If you're writing an app, you probably want <http://hackage.haskell.org/package/microlens-platform microlens-platform> – it has the most features. <http://hackage.haskell.org/package/microlens microlens> is intended more for library writers who want a tiny lens library (after all, lenses are pretty useful for everything, not just for updating records!).
src/Lens/Micro.hs view
@@ -1,13 +1,12 @@-{-# LANGUAGE-CPP,-FlexibleInstances,-FlexibleContexts,-UndecidableInstances,-RankNTypes,-ScopedTypeVariables,-MonoLocalBinds,-Trustworthy-  #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE MonoLocalBinds #-}+{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE Trustworthy #-}   {- |@@ -587,7 +586,7 @@ {- | ('^?!') is an unsafe variant of ('^?') – instead of using 'Nothing' to indicate that there were no elements returned, it throws an exception. -}-(^?!) :: s -> Getting (Endo a) s a -> a+(^?!) :: HasCallStack => s -> Getting (Endo a) s a -> a s ^?! l = foldrOf l const (error "(^?!): empty Fold") s {-# INLINE (^?!) #-} @@ -930,7 +929,7 @@  >>> [] & singular each %~ negate -}-singular :: Traversal s t a a -> Lens s t a a+singular :: HasCallStack => Traversal s t a a -> Lens s t a a singular l afb s = case ins b of   (w:ws) -> unsafeOuts b . (:ws) <$> afb w   []     -> unsafeOuts b . return <$>@@ -969,7 +968,7 @@ infixl 5 `failing`  {- |-'filtered' is a traversal that filters elements “passing” thru it:+'filtered' is a traversal that filters elements “passing” through it:  >>> (1,2,3,4) ^.. each [1,2,3,4]@@ -1032,7 +1031,7 @@ pairedWithEvens = 'each' '.' 'filtered' ('even' '.' 'fst') '.' '_2' @ -Since you can't do anything with the 1st components thru this traversal, the following holds for any @f@ and @g@:+Since you can't do anything with the 1st components through this traversal, the following holds for any @f@ and @g@:  @ 'over' pairedWithEvens f '.' 'over' pairedWithEvens g = 'over' pairedWithEvens (f '.' g)
src/Lens/Micro/Extras.hs view
@@ -1,6 +1,4 @@-{-# LANGUAGE-Trustworthy-  #-}+{-# LANGUAGE Trustworthy #-}   {- |
src/Lens/Micro/Internal.hs view
@@ -1,16 +1,16 @@-{-# LANGUAGE-CPP,-FlexibleContexts,-FlexibleInstances,-UndecidableInstances,-RankNTypes,-ScopedTypeVariables,-KindSignatures,-TypeFamilies,-MultiParamTypeClasses,-FunctionalDependencies,-Unsafe-  #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE KindSignatures #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE FunctionalDependencies #-}+{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE ImplicitParams #-}+{-# LANGUAGE Unsafe #-}   {- |@@ -52,6 +52,9 @@   Cons(..),   Snoc(..),   Strict(..),++  -- * CallStack+  HasCallStack, ) where @@ -78,6 +81,17 @@ import Unsafe.Coerce #endif +-- We don't depend on the call-stack package because building an extra+-- package is likely slower than adding several lines of code here.+#if MIN_VERSION_base(4,9,0)+import GHC.Stack (HasCallStack)+#elif MIN_VERSION_base(4,8,1)+import qualified GHC.Stack as GHC+type HasCallStack = (?callStack :: GHC.CallStack)+#else+import GHC.Exts (Constraint)+type HasCallStack = (() :: Constraint)+#endif  {- | 'traversed' traverses any 'Traversable' container (list, vector, @Map@, 'Maybe', you name it):
src/Lens/Micro/Type.hs view
@@ -1,8 +1,6 @@-{-# LANGUAGE-CPP,-RankNTypes,-Safe-  #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE Safe #-}   {- |