mirror of
https://github.com/github/semantic.git
synced 2025-01-04 05:27:08 +03:00
Add a property demonstrating the relationship between sequenceAlt
over [Maybe a]
& pure . catMaybes
.
This commit is contained in:
parent
cfb7361b9c
commit
dd0b0322fc
@ -25,6 +25,9 @@ spec = parallel $ do
|
||||
withAlternativeInstances sequenceAltLaws (sized (syntaxOfSize (const arbitrary)) :: Gen (Syntax Char Char))
|
||||
withAlternativeInstances mergeLaws (sized (syntaxOfSize (const arbitrary)) :: Gen (Syntax Char Char))
|
||||
|
||||
prop "subsumes catMaybes/Just" $ do
|
||||
\ a -> sequenceAlt a `shouldBe` pure (catMaybes (a :: [Maybe Char]))
|
||||
|
||||
mergeLaws :: forall f g a. (Mergeable f, Alternative g, Eq (g (f a)), Show (f a), Show (g (f a))) => Gen (f a) -> Gen (Blind (a -> g a)) -> Spec
|
||||
mergeLaws value function = describe "merge" $ do
|
||||
prop "identity" . forAll value $
|
||||
|
Loading…
Reference in New Issue
Block a user