packages feed

lens 5.2.3 → 5.3

raw patch · 13 files changed

+326/−39 lines, 13 filesdep −base-compatdep ~template-haskell

Dependencies removed: base-compat

Dependency ranges changed: template-haskell

Files

CHANGELOG.markdown view
@@ -1,3 +1,25 @@+5.3 [2024.05.04]+----------------+* Allow building with GHC 9.10.+* Update the `Prism`s in `Language.Haskell.TH.Lens` to reflect additions to+  `template-haskell-2.22.0.0`:+  * The `_InfixD` `Prism` now focuses on `(Fixity, NamespaceSpecifier, Name)`+    when building with `template-haskell-2.22.0.0` or later.+  * Add `Prism`s for the newly introduced `NamespaceSpecifier` data type.+  * Add `_TypeP` and `_InvisP` `Prism`s for the `Pat` data type.+  * Add a `_TypeE` `Prism` for the `Exp` data type.+  * Add a `_SCCP` `Prism` for the `Pragma` data type.+* Add the following `Setter`s for prepending and appending elements:+  * `(<>:~)`: prepend an element to the front via `(<>)`.+  * `(<<>:~)`: append an element to the back via `(<>)`.+  * `(<|~)`: cons an element to the front via `(<|)`.+  * `(<<|~)`: cons an element to the front via `(<|)` and return the result.+  * `(|>~)`: snoc an element to the back via `(|>)`.+  * `(<|>~)`: snoc an element to the back via `(|>)` and return the result.++  Each of these also has a variant that end with `=` instead of `~` (e.g.,+  `(<>:=)`) for working in a `MonadState` setting.+ 5.2.3 [2023.08.24] ------------------ * Allow building with GHC 9.8.
benchmarks/plated.hs view
@@ -4,13 +4,6 @@ {-# OPTIONS_GHC -funbox-strict-fields #-} module Main (main) where -#ifndef MIN_VERSION_base-#define MIN_VERSION_base(x,y,z) 1-#endif--import Prelude ()-import Prelude.Compat- import           Control.Lens import           Control.DeepSeq import           Criterion.Main
cabal.project view
@@ -1,7 +1,3 @@ packages: .           ./examples           ./lens-properties---- For GHC-9.6-allow-newer: vector-th-unbox-0.2.2:base-allow-newer: vector-th-unbox-0.2.2:template-haskell
examples/lens-examples.cabal view
@@ -24,9 +24,10 @@              , GHC == 8.10.7              , GHC == 9.0.2              , GHC == 9.2.8-             , GHC == 9.4.5-             , GHC == 9.6.2-             , GHC == 9.8.1+             , GHC == 9.4.8+             , GHC == 9.6.4+             , GHC == 9.8.2+             , GHC == 9.10.1  source-repository head   type: git@@ -56,7 +57,7 @@    build-depends:     base       >= 4.5   && < 5,-    containers >= 0.4   && < 0.7,+    containers >= 0.4   && < 0.8,     gloss      >= 1.12  && < 1.14,     lens,     mtl        >= 2.0.1 && < 2.4,
lens-properties/lens-properties.cabal view
@@ -21,9 +21,10 @@              , GHC == 8.10.7              , GHC == 9.0.2              , GHC == 9.2.8-             , GHC == 9.4.5-             , GHC == 9.6.2-             , GHC == 9.8.1+             , GHC == 9.4.8+             , GHC == 9.6.4+             , GHC == 9.8.2+             , GHC == 9.10.1  extra-source-files:   .hlint.yaml@@ -37,7 +38,7 @@   build-depends:     base         >= 4.9 && < 5,     lens         >= 4   && < 6,-    QuickCheck   >= 2.4 && < 2.15,+    QuickCheck   >= 2.4 && < 2.16,     transformers >= 0.2 && < 0.7    exposed-modules:
lens.cabal view
@@ -1,6 +1,6 @@ name:          lens category:      Data, Lenses, Generics-version:       5.2.3+version:       5.3 license:       BSD2 cabal-version: 1.18 license-file:  LICENSE@@ -20,9 +20,10 @@              , GHC == 8.10.7              , GHC == 9.0.2              , GHC == 9.2.8-             , GHC == 9.4.5-             , GHC == 9.6.2-             , GHC == 9.8.1+             , GHC == 9.4.8+             , GHC == 9.6.4+             , GHC == 9.8.2+             , GHC == 9.10.1 synopsis:      Lenses, Folds and Traversals description:   This package comes \"Batteries Included\" with many useful lenses for the types@@ -181,11 +182,11 @@     bytestring                    >= 0.10.4.0 && < 0.13,     call-stack                    >= 0.1      && < 0.5,     comonad                       >= 5.0.7    && < 6,-    containers                    >= 0.5.5.1  && < 0.7,+    containers                    >= 0.5.5.1  && < 0.8,     contravariant                 >= 1.4      && < 2,     distributive                  >= 0.5.1    && < 1,     exceptions                    >= 0.8.2.1  && < 1,-    filepath                      >= 1.2.0.0  && < 1.5,+    filepath                      >= 1.2.0.0  && < 1.6,     free                          >= 5.1.5    && < 6,     ghc-prim,     hashable                      >= 1.2.7.0  && < 1.5,@@ -200,8 +201,8 @@     strict                        >= 0.4      && < 0.6,     tagged                        >= 0.8.6    && < 1,     template-haskell              >= 2.11.1.0 && < 2.22,-    text                          >= 1.2.3.0  && < 2.1,-    th-abstraction                >= 0.4.1    && < 0.7,+    text                          >= 1.2.3.0  && < 2.2,+    th-abstraction                >= 0.4.1    && < 0.8,     these                         >= 1.1.1.1  && < 1.3,     transformers                  >= 0.5.0.0  && < 0.7,     transformers-compat           >= 0.5.0.4  && < 1,@@ -409,7 +410,6 @@   default-language: Haskell2010   build-depends:     base,-    base-compat >=0.11.0 && <0.14,     comonad,     criterion,     deepseq,
src/Control/Lens/Combinators.hs view
@@ -139,6 +139,12 @@   , (<?=)   , (<>~)   , (<>=)+  , (<>:~)+  , (<>:=)+  , (<|~)+  , (<|~)+  , (|>~)+  , (|>=)   , (%@~)   , (%@=)   , (:>)
src/Control/Lens/Cons.hs view
@@ -27,6 +27,7 @@   , cons   , uncons   , _head, _tail+  , (<|~), (<|=), (<<|~), (<<|=)   , pattern (:<)   -- * Snoc   , Snoc(..)@@ -34,14 +35,17 @@   , snoc   , unsnoc   , _init, _last+  , (|>~), (|>=), (<|>~), (<|>=)   , pattern (:>)    ) where  import Control.Lens.Equality (simply) import Control.Lens.Fold+import Control.Lens.Lens import Control.Lens.Prism import Control.Lens.Review+import Control.Lens.Setter import Control.Lens.Tuple import Control.Lens.Type import qualified Data.ByteString      as StrictB@@ -62,6 +66,7 @@ import qualified Data.Vector.Unboxed as Unbox import           Data.Word import           Control.Applicative (ZipList(..))+import           Control.Monad.State.Class as State import           Prelude  -- $setup@@ -77,6 +82,8 @@  infixr 5 <|, `cons` infixl 5 |>, `snoc`+infixr 4 <|~, |>~, <<|~, <|>~+infix  4 <|=, |>=, <<|=, <|>=  pattern (:<) :: Cons b b a a => a -> b -> b pattern (:<) a s <- (preview _Cons -> Just (a,s)) where@@ -323,6 +330,35 @@ _tail = _Cons._2 {-# INLINE _tail #-} +-- | Modify the target of a 'Cons' value by using @('<|')@.+--+-- >>> (["world"], ["lens"]) & _1 <|~ "hello"+-- (["hello","world"],["lens"])+(<|~) :: Cons b b a a => ASetter s t b b -> a -> s -> t+l <|~ n = over l (n <|)+{-# INLINE (<|~) #-}++-- | Modify the target(s) of a 'Lens'', 'Iso', 'Setter' or 'Traversal' by using @('<|')@.+(<|=) :: (MonadState s m, Cons b b a a) => ASetter s s b b -> a -> m ()+l <|= a = State.modify (l <|~ a)+{-# INLINE (<|=) #-}++-- | ('<|') a 'Cons' value onto the end of the target of a 'Lens' and+-- return the result.+--+-- When you do not need the result of the operation, ('Control.Lens.Cons.<|~') is more flexible.+(<<|~) :: Cons b b a a => LensLike ((,) b) s t b b -> a -> s -> (b, t)+l <<|~ m = l <%~ (m <|)+{-# INLINE (<<|~) #-}++-- | ('<|') a 'Semigroup' value onto the end of the target of a 'Lens' into+-- your 'Monad''s state and return the result.+--+-- When you do not need the result of the operation, ('Control.Lens.Cons.<|=') is more flexible.+(<<|=) :: (MonadState s m, Cons b b a a) => LensLike ((,) b) s s b b -> a -> m b+l <<|= r = l <%= (r <|)+{-# INLINE (<<|=) #-}+ ------------------------------------------------------------------------------ -- Snoc ------------------------------------------------------------------------------@@ -538,3 +574,32 @@ unsnoc :: Snoc s s a a => s -> Maybe (s, a) unsnoc = simply preview _Snoc {-# INLINE unsnoc #-}++-- | Modify the target of a 'Cons' value by using @('|>')@.+--+-- >>> (["world"], ["lens"]) & _1 |>~ "hello"+-- (["world","hello"],["lens"])+(|>~) :: Snoc b b a a => ASetter s t b b -> a -> s -> t+l |>~ n = over l (|> n)+{-# INLINE (|>~) #-}++-- | Modify the target(s) of a 'Lens'', 'Iso', 'Setter' or 'Traversal' by using @('|>')@.+(|>=) :: (MonadState s m, Snoc b b a a) => ASetter s s b b -> a -> m ()+l |>= a = State.modify (l |>~ a)+{-# INLINE (|>=) #-}++-- | ('|>') a 'Cons' value onto the end of the target of a 'Lens' and+-- return the result.+--+-- When you do not need the result of the operation, ('Control.Lens.Cons.|>~') is more flexible.+(<|>~) :: Snoc b b p p => LensLike ((,) b) s t b b -> p -> s -> (b, t)+l <|>~ m = l <%~ (|> m)+{-# INLINE (<|>~) #-}++-- | ('|>') a 'Semigroup' value onto the end of the target of a 'Lens' into+-- your 'Monad''s state and return the result.+--+-- When you do not need the result of the operation, ('Control.Lens.Cons.|>=') is more flexible.+(<|>=) :: (MonadState s m, Snoc b b p p) => LensLike ((,) b) s s b b -> p -> m b+l <|>= r = l <%= (|> r)+{-# INLINE (<|>=) #-}
src/Control/Lens/Lens.hs view
@@ -87,7 +87,7 @@   -- * Setting Functionally with Passthrough   , (<%~), (<+~), (<-~), (<*~), (<//~)   , (<^~), (<^^~), (<**~)-  , (<||~), (<&&~), (<<>~)+  , (<||~), (<&&~), (<<>~), (<<>:~)   , (<<%~), (<<.~), (<<?~), (<<+~), (<<-~), (<<*~)   , (<<//~), (<<^~), (<<^^~), (<<**~)   , (<<||~), (<<&&~), (<<<>~)@@ -95,7 +95,7 @@   -- * Setting State with Passthrough   , (<%=), (<+=), (<-=), (<*=), (<//=)   , (<^=), (<^^=), (<**=)-  , (<||=), (<&&=), (<<>=)+  , (<||=), (<&&=), (<<>=), (<<>:=)   , (<<%=), (<<.=), (<<?=), (<<+=), (<<-=), (<<*=)   , (<<//=), (<<^=), (<<^^=), (<<**=)   , (<<||=), (<<&&=), (<<<>=)@@ -163,9 +163,9 @@ -- >>> let setter :: Expr -> Expr -> Expr; setter = fun "setter"  infixl 8 ^#-infixr 4 %%@~, <%@~, <<%@~, %%~, <+~, <*~, <-~, <//~, <^~, <^^~, <**~, <&&~, <||~, <<>~, <%~, <<%~, <<.~, <<?~, <#~, #~, #%~, <#%~, #%%~+infixr 4 %%@~, <%@~, <<%@~, %%~, <+~, <*~, <-~, <//~, <^~, <^^~, <**~, <&&~, <||~, <<>~, <<>:~, <%~, <<%~, <<.~, <<?~, <#~, #~, #%~, <#%~, #%%~        , <<+~, <<-~, <<*~, <<//~, <<^~, <<^^~, <<**~, <<||~, <<&&~, <<<>~-infix  4 %%@=, <%@=, <<%@=, %%=, <+=, <*=, <-=, <//=, <^=, <^^=, <**=, <&&=, <||=, <<>=, <%=, <<%=, <<.=, <<?=, <#=, #=, #%=, <#%=, #%%=+infix  4 %%@=, <%@=, <<%@=, %%=, <+=, <*=, <-=, <//=, <^=, <^^=, <**=, <&&=, <||=, <<>=, <<>:=, <%=, <<%=, <<.=, <<?=, <#=, #=, #%=, <#%=, #%%=        , <<+=, <<-=, <<*=, <<//=, <<^=, <<^^=, <<**=, <<||=, <<&&=, <<<>= infixr 2 <<~ infixl 1 ??, &~@@ -1191,6 +1191,24 @@ (<<>=) :: (MonadState s m, Semigroup r) => LensLike' ((,)r) s r -> r -> m r l <<>= r = l <%= (<> r) {-# INLINE (<<>=) #-}++-- | ('<>') a 'Semigroup' value onto the end of the target of a 'Lens' and+-- return the result.+-- However, unlike '<<>~', it is prepend to the head side.+--+-- When you do not need the result of the operation, ('Control.Lens.Setter.<>:~') is more flexible.+(<<>:~) :: Semigroup m => LensLike ((,)m) s t m m -> m -> s -> (m, t)+l <<>:~ m = l <%~ (m <>)+{-# INLINE (<<>:~) #-}++-- | ('<>') a 'Semigroup' value onto the end of the target of a 'Lens' into+-- your 'Monad''s state and return the result.+-- However, unlike '<<>=', it is prepend to the head side.+--+-- When you do not need the result of the operation, ('Control.Lens.Setter.<>:=') is more flexible.+(<<>:=) :: (MonadState s m, Semigroup r) => LensLike' ((,)r) s r -> r -> m r+l <<>:= r = l <%= (r <>)+{-# INLINE (<<>:=) #-}  ------------------------------------------------------------------------------ -- Arrow operators
src/Control/Lens/Setter.hs view
@@ -49,11 +49,11 @@   , over   , set   , (.~), (%~)-  , (+~), (-~), (*~), (//~), (^~), (^^~), (**~), (||~), (<>~), (&&~), (<.~), (?~), (<?~)+  , (+~), (-~), (*~), (//~), (^~), (^^~), (**~), (||~), (<>~), (<>:~), (&&~), (<.~), (?~), (<?~)   -- * State Combinators   , assign, modifying   , (.=), (%=)-  , (+=), (-=), (*=), (//=), (^=), (^^=), (**=), (||=), (<>=), (&&=), (<.=), (?=), (<?=)+  , (+=), (-=), (*=), (//=), (^=), (^^=), (**=), (||=), (<>=), (<>:=), (&&=), (<.=), (?=), (<?=)   , (<~)   -- * Writer Combinators   , scribe@@ -80,8 +80,8 @@  import Control.Arrow import Control.Comonad-import Control.Lens.Internal.Prelude import Control.Lens.Internal.Indexed+import Control.Lens.Internal.Prelude import Control.Lens.Internal.Setter import Control.Lens.Type import Control.Monad (liftM)@@ -105,8 +105,8 @@ -- >>> let setter :: Expr -> Expr -> Expr; setter = fun "setter" -- >>> :set -XNoOverloadedStrings -infixr 4 %@~, .@~, .~, +~, *~, -~, //~, ^~, ^^~, **~, &&~, <>~, ||~, %~, <.~, ?~, <?~-infix  4 %@=, .@=, .=, +=, *=, -=, //=, ^=, ^^=, **=, &&=, <>=, ||=, %=, <.=, ?=, <?=+infixr 4 %@~, .@~, .~, +~, *~, -~, //~, ^~, ^^~, **~, &&~, <>~, <>:~, ||~, %~, <.~, ?~, <?~+infix  4 %@=, .@=, .=, +=, *=, -=, //=, ^=, ^^=, **=, &&=, <>=, <>:=, ||=, %=, <.=, ?=, <?= infixr 2 <~  ------------------------------------------------------------------------------@@ -1069,6 +1069,24 @@ (<>=) :: (MonadState s m, Semigroup a) => ASetter' s a -> a -> m () l <>= a = State.modify (l <>~ a) {-# INLINE (<>=) #-}++-- | Modify the target of a 'Semigroup' value by using @('<>')@.+-- However, unlike '<>~', it is prepend to the head side.+--+-- >>> ["world"] & id <>:~ ["hello"]+-- ["hello","world"]+--+-- >>> (["world"], ["lens"]) & _1 <>:~ ["hello"]+-- (["hello","world"],["lens"])+(<>:~) :: Semigroup b => ASetter s t b b -> b -> s -> t+l <>:~ n = over l (n <>)+{-# INLINE (<>:~) #-}++-- | Modify the target(s) of a 'Lens'', 'Iso', 'Setter' or 'Traversal' by using @('<>')@.+-- However, unlike '<>=', it is prepend to the head side.+(<>:=) :: (MonadState s m, Semigroup a) => ASetter' s a -> a -> m ()+l <>:= a = State.modify (l <>:~ a)+{-# INLINE (<>:=) #-}  ----------------------------------------------------------------------------- -- Writer Operations
src/Control/Monad/Error/Lens.hs view
@@ -211,8 +211,8 @@ -- @'throwing' l ≡ 'reviews' l 'throwError'@ -- -- @--- 'throwing' :: 'MonadError' e m => 'Prism'' e t -> t -> a--- 'throwing' :: 'MonadError' e m => 'Iso'' e t   -> t -> a+-- 'throwing' :: 'MonadError' e m => 'Prism'' e t -> t -> m a+-- 'throwing' :: 'MonadError' e m => 'Iso'' e t   -> t -> m a -- @ throwing :: MonadError e m => AReview e t -> t -> m x throwing l = reviews l throwError
src/Language/Haskell/TH/Lens.hs view
@@ -148,6 +148,12 @@   , _ForallC   , _GadtC   , _RecGadtC+#if MIN_VERSION_template_haskell(2,22,0)+  -- ** NamespaceSpecifier Prisms+  , _NoNamespaceSpecifier+  , _TypeNamespaceSpecifier+  , _DataNamespaceSpecifier+#endif   -- ** Overlap Prisms   ,_Overlappable   ,_Overlapping@@ -191,6 +197,9 @@ #if MIN_VERSION_template_haskell(2,19,0)   , _OpaqueP #endif+#if MIN_VERSION_template_haskell(2,22,0)+  , _SCCP+#endif   -- ** Inline Prisms   , _NoInline   , _Inline@@ -269,6 +278,9 @@   , _TypedBracketE   , _TypedSpliceE #endif+#if MIN_VERSION_template_haskell(2,22,0)+  , _TypeE+#endif   -- ** Body Prisms   , _GuardedB   , _NormalB@@ -322,6 +334,10 @@   , _ListP   , _SigP   , _ViewP+#if MIN_VERSION_template_haskell(2,22,0)+  , _TypeP+  , _InvisP+#endif   -- ** Type Prisms   , _ForallT   , _AppT@@ -934,6 +950,32 @@       remitter (InstanceD x y z w) = Just (x, y, z, w)       remitter _ = Nothing +#if MIN_VERSION_template_haskell(2,22,0)+_NoNamespaceSpecifier :: Prism' NamespaceSpecifier ()+_NoNamespaceSpecifier+  = prism' reviewer remitter+  where+      reviewer () = NoNamespaceSpecifier+      remitter NoNamespaceSpecifier = Just ()+      remitter _ = Nothing++_TypeNamespaceSpecifier :: Prism' NamespaceSpecifier ()+_TypeNamespaceSpecifier+  = prism' reviewer remitter+  where+      reviewer () = TypeNamespaceSpecifier+      remitter TypeNamespaceSpecifier = Just ()+      remitter _ = Nothing++_DataNamespaceSpecifier :: Prism' NamespaceSpecifier ()+_DataNamespaceSpecifier+  = prism' reviewer remitter+  where+      reviewer () = DataNamespaceSpecifier+      remitter DataNamespaceSpecifier = Just ()+      remitter _ = Nothing+#endif+ _Overlappable  :: Prism' Overlap  () _Overlappable  = prism' reviewer remitter   where@@ -978,6 +1020,20 @@       remitter (ForeignD x) = Just x       remitter _ = Nothing +-- |+-- @+-- _InfixD :: 'Prism'' 'Dec' ('Fixity', 'NamespaceSpecifier', 'Name') -- template-haskell-2.22++-- _InfixD :: 'Prism'' 'Dec' ('Fixity', 'Name')                     -- Earlier versions+-- @+#if MIN_VERSION_template_haskell(2,22,0)+_InfixD :: Prism' Dec (Fixity, NamespaceSpecifier, Name)+_InfixD+  = prism' reviewer remitter+  where+      reviewer (x, y, z) = InfixD x y z+      remitter (InfixD x y z) = Just (x, y, z)+      remitter _ = Nothing+#else _InfixD :: Prism' Dec (Fixity, Name) _InfixD   = prism' reviewer remitter@@ -985,6 +1041,7 @@       reviewer (x, y) = InfixD x y       remitter (InfixD x y) = Just (x, y)       remitter _ = Nothing+#endif  _PragmaD :: Prism' Dec Pragma _PragmaD@@ -1544,6 +1601,16 @@       remitter _ = Nothing #endif +#if MIN_VERSION_template_haskell(2,22,0)+_SCCP :: Prism' Pragma (Name, Maybe String)+_SCCP+  = prism' reviewer remitter+  where+      reviewer (x, y) = SCCP x y+      remitter (SCCP x y) = Just (x, y)+      remitter _ = Nothing+#endif+ _NoInline :: Prism' Inline () _NoInline   = prism' reviewer remitter@@ -2060,6 +2127,16 @@       remitter _ = Nothing #endif +#if MIN_VERSION_template_haskell(2,22,0)+_TypeE :: Prism' Exp Type+_TypeE+  = prism' reviewer remitter+  where+      reviewer = TypeE+      remitter (TypeE x) = Just x+      remitter _ = Nothing+#endif+ _GuardedB :: Prism' Body [(Guard, Exp)] _GuardedB   = prism' reviewer remitter@@ -2408,6 +2485,24 @@       reviewer (x, y) = ViewP x y       remitter (ViewP x y) = Just (x, y)       remitter _ = Nothing++#if MIN_VERSION_template_haskell(2,22,0)+_TypeP :: Prism' Pat Type+_TypeP+  = prism' reviewer remitter+  where+      reviewer = TypeP+      remitter (TypeP x) = Just x+      remitter _ = Nothing++_InvisP :: Prism' Pat Type+_InvisP+  = prism' reviewer remitter+  where+      reviewer = InvisP+      remitter (InvisP x) = Just x+      remitter _ = Nothing+#endif  _ForallT :: Prism' Type ([TyVarBndrSpec], Cxt, Type) _ForallT
tests/hunit.hs view
@@ -231,6 +231,66 @@     test = points <<>= [ origin ]     trig' = trig { _points = (trig & _points) <> [ origin ] } +case_prepend_to_record_field =+  (trig & points <>:~ [ origin ])+    @?= trig { _points = [ origin ] <> (trig & _points) }++case_prepend_to_state_record_field = do+  runState test trig @?= ((), trig')+  where+    test = points <>:= [ origin ]+    trig' = trig { _points = [ origin ] <> (trig & _points) }++case_prepend_to_record_field_and_access_new_value =+  (trig & points <<>:~ [ origin ])+    @?= ([ origin ] <> _points trig, trig { _points = [ origin ] <> (trig & _points) })++case_prepend_to_state_record_field_and_access_new_value = do+  runState test trig @?= ([ origin ] <> _points trig, trig')+  where+    test = points <<>:= [ origin ]+    trig' = trig { _points = [ origin ] <> (trig & _points) }++case_cons_to_record_field =+  (trig & points <|~ origin)+    @?= trig { _points = origin : (trig & _points) }++case_cons_to_state_record_field = do+  runState test trig @?= ((), trig')+  where+    test = points <|= origin+    trig' = trig { _points = origin : (trig & _points) }++case_cons_to_record_field_and_access_new_value =+  (trig & points <<|~ origin)+    @?= (origin : _points trig, trig { _points = origin : (trig & _points) })++case_cons_to_state_record_field_and_access_new_value =+  runState test trig @?= ([ origin ] <> _points trig, trig')+  where+    test = points <<|= origin+    trig' = trig { _points = origin : (trig & _points) }++case_snoc_to_record_field =+  (trig & points |>~ origin)+    @?= trig { _points = (trig & _points) `snoc` origin }++case_snoc_to_state_record_field = do+  runState test trig @?= ((), trig')+  where+    test = points |>= origin+    trig' = trig { _points = (trig & _points) `snoc` origin }++case_snoc_to_record_field_and_access_new_value =+  (trig & points <|>~ origin)+    @?= (_points trig `snoc` origin, trig { _points = (trig & _points) `snoc` origin })++case_snoc_to_state_record_field_and_access_new_value =+  runState test trig @?= (_points trig <> [ origin ], trig')+  where+    test = points <|>= origin+    trig' = trig { _points = (trig & _points) `snoc` origin }+ case_append_to_record_field_and_access_old_value =   (trig & points <<%~ (<>[origin]))     @?= (_points trig, trig { _points = (trig & _points) <> [ origin ] })@@ -323,8 +383,20 @@     , testCase "increment state record field" case_increment_state_record_field     , testCase "append to record field" case_append_to_record_field     , testCase "append to state record field" case_append_to_state_record_field+    , testCase "prepend to record field" case_prepend_to_record_field+    , testCase "prepend to state record field" case_prepend_to_state_record_field+    , testCase "cons to record field" case_cons_to_record_field+    , testCase "cons to state record field" case_cons_to_state_record_field+    , testCase "snoc to record field" case_snoc_to_record_field+    , testCase "snoc to state record field" case_snoc_to_state_record_field     , testCase "append to record field and access new value" case_append_to_record_field_and_access_new_value     , testCase "append to state record field and access new value" case_append_to_state_record_field_and_access_new_value+    , testCase "prepend to record field and access new value" case_prepend_to_record_field_and_access_new_value+    , testCase "prepend to state record field and access new value" case_prepend_to_state_record_field_and_access_new_value+    , testCase "cons to record field and access new value" case_cons_to_record_field_and_access_new_value+    , testCase "cons to state record field and access new value" case_cons_to_state_record_field_and_access_new_value+    , testCase "snoc to record field and access new value" case_snoc_to_record_field_and_access_new_value+    , testCase "snoc to state record field and access new value" case_snoc_to_state_record_field_and_access_new_value     , testCase "append to record field and access old value" case_append_to_record_field_and_access_old_value     , testCase "append to state record field and access old value" case_append_to_state_record_field_and_access_old_value     , testCase "read maybe map entry" case_read_maybe_map_entry