focus 1.0.1.3 → 1.0.1.4
raw patch · 3 files changed
+10/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- focus.cabal +1/−1
- library/Focus.hs +1/−1
- test/Main.hs +8/−0
focus.cabal view
@@ -1,5 +1,5 @@ name: focus-version: 1.0.1.3+version: 1.0.1.4 synopsis: A general abstraction for manipulating elements of container data structures description: An API for construction of free-form strategies of access and manipulation of
library/Focus.hs view
@@ -146,7 +146,7 @@ -} {-# INLINE update #-} update :: Monad m => (a -> Maybe a) -> Focus a m ()-update fn = unitCases Leave (maybe Leave Set . fn)+update fn = unitCases Leave (maybe Remove Set . fn) -- ** Construction utils -------------------------
test/Main.hs view
@@ -41,4 +41,12 @@ in do assertEqual "" ((), Focus.Set "one") (runIdentity (present "zero")) assertEqual "" ((), Focus.Set "one") (runIdentity absent)+ ,+ testCase "update" $ let+ f :: String -> Maybe String+ f = const Nothing+ Focus.Focus absent present = Focus.update f+ in do+ assertEqual "" ((), Focus.Remove) (runIdentity (present "zero"))+ assertEqual "" ((), Focus.Leave) (runIdentity absent) ]