Hoogle Search
Within LTS Haskell 24.28 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
row-types Data.Row.Records A function to map over a Ap record given constraints.
-
row-types Data.Row.Variants A function to map over a variant given no constraint.
-
sbv Data.SBV.Internals Map a unary function through a CV.
-
sbv Data.SBV.Internals Map a binary function through a CV.
-
sbv Data.SBV.Maybe Map over two maybe values.
mapAppend :: (SA -> SB) -> IO Proofsbv Documentation.SBV.Examples.KnuckleDragger.Lists map f (xs ++ ys) == map f xs ++ map f ys
>>> mapAppend (uninterpret "f") Inductive lemma: mapAppend Step: Base Q.E.D. Step: 1 Q.E.D. Step: 2 Q.E.D. Step: 3 Q.E.D. Step: 4 Q.E.D. Step: 5 Q.E.D. Result: Q.E.D. [Proven] mapAppend
-
sbv Documentation.SBV.Examples.KnuckleDragger.Lists f = g => map f xs = map g xs
>>> mapEquiv Inductive lemma: mapEquiv Step: Base Q.E.D. Step: 1 Q.E.D. Step: 2 Q.E.D. Step: 3 Q.E.D. Step: 4 Q.E.D. Result: Q.E.D. [Proven] mapEquiv
-
sbv Documentation.SBV.Examples.KnuckleDragger.Lists In general, mapping and filtering operations do not commute. We'll see the kind of counter-example we get from SBV if we attempt to prove:
>>> mapFilter `catch` (\(_ :: SomeException) -> pure ()) Lemma: badMapFilter *** Failed to prove badMapFilter. Falsifiable. Counter-example: xs = [A_3] :: [A] lhs = [A_0] :: [A] rhs = [] :: [A] f :: A -> A f _ = A_0 p :: A -> Bool p A_3 = True p _ = False
As expected, the function f maps everything to A_0, and the predicate p only lets A_3 through. As shown in the counter-example, for the input [A_3], left-hand-side filters nothing and the result is the singleton A_0. But the map on the right-hand side maps everything to [A_0] and the filter gets rid of the elements, resulting in an empty list. -
sbv Documentation.SBV.Examples.KnuckleDragger.Lists map f . reverse == reverse . map f
>>> mapReverse Inductive lemma: mapAppend Step: Base Q.E.D. Step: 1 Q.E.D. Step: 2 Q.E.D. Step: 3 Q.E.D. Step: 4 Q.E.D. Step: 5 Q.E.D. Result: Q.E.D. Inductive lemma: mapReverse Step: Base Q.E.D. Step: 1 Q.E.D. Step: 2 Q.E.D. Step: 3 Q.E.D. Step: 4 Q.E.D. Step: 5 Q.E.D. Step: 6 Q.E.D. Result: Q.E.D. [Proven] mapReverse
-
sbv Documentation.SBV.Examples.KnuckleDragger.Lists length xs = length ys ⟹ map fst (zip xs ys) = xs
>>> map_fst_zip Inductive lemma: map_fst_zip Step: Base Q.E.D. Step: 1 Q.E.D. Step: 2 Q.E.D. Step: 3 Q.E.D. Step: 4 Q.E.D. Result: Q.E.D. [Proven] map_fst_zip