Skip to content

Commit

Permalink
fix arbitrary Termprim
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoosten committed Sep 17, 2023
1 parent 2e3c467 commit d5d465c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Ampersand/Test/Parser/ArbitraryTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,15 @@ instance Arbitrary TermPrim where
arbitrary =
oneof
[ PI <$> arbitrary,
Pid <$> arbitrary <*> arbitrary,
Patm <$> arbitrary <*> arbitrary <*> arbitrary,
Pid <$> arbitrary <*> arbitrary `suchThat` noLabel,
Patm <$> arbitrary <*> arbitrary <*> arbitrary `suchThat` noMaybeLabel,
PVee <$> arbitrary,
Pfull <$> arbitrary <*> arbitrary <*> arbitrary,
Pfull <$> arbitrary <*> arbitrary `suchThat` noLabel <*> arbitrary `suchThat` noLabel,
PNamedR <$> arbitrary
]
where
noMaybeLabel :: Maybe P_Concept -> Bool
noMaybeLabel = maybe True noLabel

instance Arbitrary (PairView (Term TermPrim)) where
arbitrary = PairView <$> arbitrary
Expand Down

0 comments on commit d5d465c

Please sign in to comment.