-
Notifications
You must be signed in to change notification settings - Fork 27
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
Syntax of refinement types #110
Comments
This is a great suggestion. I’ve added it elsewhere (in talks/slides) but
would really help here too! Are there particularly tricky/egregious
mismatches that you recall?
…On Tue, Jul 13, 2021 at 5:37 AM John Lång ***@***.***> wrote:
I've read through the chapters 1 to 7 and haven't come accross a
definition of the syntax of refinement types. I was expecting to see it
rather early in the book. A BNF would be helpful. It seems that sometimes
the same condition needs to be formulated differently in Haskell and
LiquidHaskell. Mixing up Haskell and LiquidHaskell syntax seems to lead
into often quite cryptic errors.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ucsd-2Dprogsys_liquidhaskell-2Dtutorial_issues_110&d=DwMCaQ&c=-35OiAkTchMrZOngvJPOeA&r=r3JfTqNkpwIJ1InE9-ChC2ld7xwATxgUx5XHAdA0UnA&m=S16HXtwImXn3-oN6dOvMcFXdHw8FwAIqdU3g0lQ5Iw0&s=Tcc3I6Rzj27YWP6W9oxs7NGr3SiQyqsinrqjOuyM89o&e=>,
or unsubscribe
<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AAMS4OFROIXQAM6JSAL2VVLTXQXPTANCNFSM5AJAQUHA&d=DwMCaQ&c=-35OiAkTchMrZOngvJPOeA&r=r3JfTqNkpwIJ1InE9-ChC2ld7xwATxgUx5XHAdA0UnA&m=S16HXtwImXn3-oN6dOvMcFXdHw8FwAIqdU3g0lQ5Iw0&s=Cjnp5PyihmO_HtLz4D3e8_0q81KP5SSZGB4x1lCko4c&e=>
.
|
Apparently, things like lambda terms and infix notation with backticks don't work with refinement types. This example is quite contrived but I think it makes my point clear: The type of lists of odd integers can be expressed as follows:
The error message makes it look like as if the problem was with the colon while in reality the cause was the use of backticks. Of course, using |
I think that a chapter listing some common error types along with explanations would be very valuable to beginners like me. |
I take it that the backticks are not supported by the refinement type syntax. A beginner might be tempted to try to use them. |
I've read through the chapters 1 to 7 and haven't come accross a definition of the syntax of refinement types. I was expecting to see it rather early in the book. A BNF would be helpful. It seems that sometimes the same condition needs to be formulated differently in Haskell and LiquidHaskell. Mixing up Haskell and LiquidHaskell syntax seems to lead into often quite cryptic errors.
The text was updated successfully, but these errors were encountered: