-
Notifications
You must be signed in to change notification settings - Fork 28
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
liquidhaskell error about merge example #76
Comments
You can also see the error on the web page (http://ucsd-progsys.github.io/liquidhaskell-tutorial/05-datatypes.html) if you click the compile button. |
I encountered the same error, but I found that add a line merge :: (Ord a) => IncList a -> IncList a -> IncList a
merge Emp ys = ys
merge xs Emp = xs
merge (x :< xs) (y :< ys)
| x <= y = x :< (merge xs (y :< ys))
| otherwise = y :< (merge (x :< xs) ys)
merge _ _ = Emp This may pass liquid haskell safe check. |
Yes this seems like some unfortunate consequence of how new versions of GHC
desugar pattern matches. This seems related to the issue #1396
Posted by @wkunkel.
Does the suggested extra case work? If so will update tutorial
appropriately.
…On Mon, Jan 21, 2019 at 5:03 AM Alex Chi ***@***.***> wrote:
I encountered the same error, but I found that add a line merge _ _ = Emp
makes sense. Here's my code:
merge :: (Ord a) => IncList a -> IncList a -> IncList a
merge Emp ys = ys
merge xs Emp = xs
merge (x :< xs) (y :< ys)
| x <= y = x :< (merge xs (y :< ys))
| otherwise = y :< (merge (x :< xs) ys)
merge _ _ = Emp
This may pass liquid haskell safe check.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#76 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABkuOGKB5J6CZPmQGDQ0wE9o00wIXm0Wks5vFbp-gaJpZM4ZyfDi>
.
|
Here's my code, and it passes Travis check. https://github.com/SkyZH/playground.lhs/blob/master/src/Ex42.hs#L129 |
Fantastic! Can you send a PR? (If not I can manually do it...)
…On Tue, Jan 22, 2019 at 4:41 AM Alex Chi ***@***.***> wrote:
Here's my code, and it passes Travis check.
https://github.com/SkyZH/playground.lhs/blob/master/src/Ex42.hs#L129
https://travis-ci.com/SkyZH/playground.lhs
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#76 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABkuOLaxkEDwhoJ5gIXYT7bBHhCJSgSvks5vFuqXgaJpZM4ZyfDi>
.
|
I've already sent #78 yesterday :) @ranjitjhala |
Liquidhaskell reports an error with one of the examples:
The code it's complaining about is this:
The text was updated successfully, but these errors were encountered: