Skip to content

Wingman: Fix #1879 #2644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ deriveArbitrary = do
mempty
mempty
mempty
$ noLoc $
let' [valBind (fromString "terminal") $ list $ fmap genExpr terminal] $
$ noLoc $ case terminal of
[onlyCon] -> genExpr onlyCon -- See #1879
_ -> let' [valBind (fromString "terminal") $ list $ fmap genExpr terminal] $
appDollar (mkFunc "sized") $ lambda [bvar' (mkVarOcc "n")] $
case' (infixCall "<=" (mkVal "n") (int 1))
[ match [conP (fromString "True") []] $
Expand Down
1 change: 1 addition & 0 deletions plugins/hls-tactics-plugin/test/CodeAction/AutoSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ spec = do

describe "known" $ do
autoTest 25 13 "GoldenArbitrary"
autoTest 6 13 "GoldenArbitrarySingleConstructor"
autoTestNoWhitespace
6 10 "KnownBigSemigroup"
autoTest 4 10 "KnownThetaSemigroup"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data Gen a

data Obj = Obj Int Bool Char String

arbitrary :: Gen Obj
arbitrary
= (((Obj <$> arbitrary) <*> arbitrary) <*> arbitrary) <*> arbitrary
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
data Gen a

data Obj = Obj Int Bool Char String

arbitrary :: Gen Obj
arbitrary = _