Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Various simplifications #898

Merged
merged 1 commit into from
Oct 24, 2018
Merged

Various simplifications #898

merged 1 commit into from
Oct 24, 2018

Conversation

jhrcek
Copy link
Collaborator

@jhrcek jhrcek commented Oct 23, 2018

Hello @alanz I'd like to join in and contribute to this project.
I made some simplifications and typo fixes while getting acquainted with the code base.

However I'm running into problem when running make test:
Some LiquidSpec.hs tests were failing, because I didn't have liquid binary (see TODO comment in this PR).
I didn't find any instructions in this project on how to set that up, so I followed the install instructions of liquidhaskell but that didn't fix the tests (the output of the latest liquid binary didn't correspond to test expectations).
I'll be happy if you could assist me with making the tests work.


let candidates' = [hieBin, backupHieBin, "hie"]
candidates = map (++ exeExtension) candidates'
logm $ "hie exe candidates :" ++ show candidates
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous impl didn't list all 3 candidates that the program is searching for. Also switched to dropWhileEnd to avoid the need to reverse twice.

let mLogFileName = case optLogFile opts of
Just f -> Just f
Nothing -> Nothing
let mLogFileName = optLogFile opts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

else do
L.infoM "hie" "Using plain GHC version"
tryCommand "ghc --version"
tryCommand "ghc --numeric-version"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know this existed, very handy!

msg `shouldSatisfy` isPrefixOf "RESULT\n[{\"start\":{\"line\":9,\"column\":1},\"stop\":{\"line\":9,\"column\":8},\"message\":\"Error: Liquid Type Mismatch\\n Inferred type\\n VV : {v : Int | v == (7 : int)}\\n \\n not a subtype of Required type\\n VV : {VV : Int | VV mod 2 == 0}\\n"
ef `shouldBe` ExitFailure 1
Just (_, []) -> error "Didn't get any output from liquid binary"
Nothing -> error "This test requires 'liquid' binary to be present on your PATH. Follow the steps in docs/Hacking.md to install it."
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attempt to give more informative error than "failed pattern match" when liquid is not installed.

Copy link
Contributor

@meck meck Oct 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did something similar here might be a bit much to crash on this error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks. I'm going to remove the changes to that file from my PR..

@jhrcek
Copy link
Collaborator Author

jhrcek commented Oct 23, 2018

I updated the PR, removing the TODO from the test.

But I'm still struggling with couple of tests related to liquid failing. I installed liquid using these steps and copied the resulting liquid binary on my path (~/.local/bin). The errors I'm getting:

Test expects:

"Error: Liquid Type Mismatch\n  Inferred type\n    VV : {v : Int | v == (7 : int)}\n \n  not a subtype of Required type\n    VV : {VV : Int | VV mod 2 == 0}\n")

Actual result from liquid:

"Error: Liquid Type Mismatch\n  Inferred type\n    VV : {v : GHC.Types.Int | v == 7}\n \n  not a subtype of Required type\n    VV : {VV : GHC.Types.Int | VV mod 2 == 0}\n "

@jhrcek
Copy link
Collaborator Author

jhrcek commented Oct 24, 2018

So I finally managed to install liquid 0.8.2.4 locally and the tests work for me except for #900 (comment) . I removed rebased this PR onto master and removed my changes to LiquidSpec.hs from this PR

@alanz alanz merged commit ff1883f into haskell:master Oct 24, 2018
@alanz alanz added this to the prehistory milestone Feb 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants