Comments (7)
Yikes this is my bad. I will fix the parser! In the meantime just use =>
For implies!
On Apr 5, 2015, at 12:58 PM, chowells79 [email protected] wrote:
The examples look like this:
{-@ ex3 :: Bool -> Bool -> TRUE @-}
ex3 a b = (a && b) ==> a{-@ ex4 :: Bool -> Bool -> TRUE @-}
ex4 a b = (a && b) ==> b
When attempting to verify the first of those, I get:**** ERROR: Invalid Source *****************************************************
tutorial-ch2.hs:19:20-22: Error: GHC Error
Not in scope: ‘==>’
Perhaps you meant ‘==’ (imported from Prelude)
What am I missing? Just adding the definition of (==>) from earlier in the chapter doesn't fix it. I end up getting:**** UNSAFE ********************************************************************
tutorial-ch2.hs:19:11-24: Error: Liquid Type Mismatch
Inferred type
VV : Boolnot a subtype of Required type
VV : Bool | Prop VVIn Context
VV : Bool
I assume this is because liquid haskell doesn't look inside definitions, and just uses Bool -> Bool -> Bool as the type for (==>) when it lacks an accurate liquid haskell annotation.—
Reply to this email directly or view it on GitHub.
from liquidhaskell-tutorial.
@chowells79 did you install from hackage or github? This issue is fixed in master so should be fine if you rebuild from there. Apologies for not updating hackage together with the tutorial!
@gridaphobe I think we should do a new release on hackage, perhaps after @nikivazou is done with they recent slew of bug fixes? (Thanks!)
On Apr 5, 2015, at 12:58 PM, chowells79 [email protected] wrote:
The examples look like this:
{-@ ex3 :: Bool -> Bool -> TRUE @-}
ex3 a b = (a && b) ==> a{-@ ex4 :: Bool -> Bool -> TRUE @-}
ex4 a b = (a && b) ==> b
When attempting to verify the first of those, I get:**** ERROR: Invalid Source *****************************************************
tutorial-ch2.hs:19:20-22: Error: GHC Error
Not in scope: ‘==>’
Perhaps you meant ‘==’ (imported from Prelude)
What am I missing? Just adding the definition of (==>) from earlier in the chapter doesn't fix it. I end up getting:**** UNSAFE ********************************************************************
tutorial-ch2.hs:19:11-24: Error: Liquid Type Mismatch
Inferred type
VV : Boolnot a subtype of Required type
VV : Bool | Prop VVIn Context
VV : Bool
I assume this is because liquid haskell doesn't look inside definitions, and just uses Bool -> Bool -> Bool as the type for (==>) when it lacks an accurate liquid haskell annotation.—
Reply to this email directly or view it on GitHub.
from liquidhaskell-tutorial.
I installed from hackage. I'll give it a shot with a build from github later on and report.
from liquidhaskell-tutorial.
Same error on a build from github. I suspect you may have misdiagnosed the problem. The example shows using (==>) in the term-level expression, which isn't defined.
from liquidhaskell-tutorial.
Sorry! Are you using this file from the tutorial src/ directory
https://github.com/ucsd-progsys/liquidhaskell-tutorial/blob/master/src/02-logic.lhs#L132
As you can see it's defined there so I'm puzzled as to why ghc is complaining.
Else can you post a gist of the file you are running through liquid?
Thanks!
On hid Apr 6, 2015, at 3:55 AM, chowells79 [email protected] wrote:
Same error on a build from github. I suspect you may have misdiagnosed the problem. The example shows using (==>) in the term-level expression, which isn't defined.
—
Reply to this email directly or view it on GitHub.
from liquidhaskell-tutorial.
Ok got it! Looks like you created a NEW file, and copied the CODE for ==> over but didn't copy the SPEC over; that is shown at the top of the file over here
https://github.com/ucsd-progsys/liquidhaskell-tutorial/blob/master/src/02-logic.lhs#L10
So you should add that in addition to the code for ==>
From here
https://github.com/ucsd-progsys/liquidhaskell-tutorial/blob/master/src/02-logic.lhs#L132
(I didn't show the spec in chapter 2 because refinement types are only properly introduced in ch 3)
And yet I wanted to sneak them in just to get tangible feedback for the logical queries and validity.
Apologies for the confusion!
from liquidhaskell-tutorial.
That's exactly the issue - I created a new file in which to do the exercises from the chapter.
from liquidhaskell-tutorial.
Related Issues (20)
- Regarding reverse in Ch 8: Sets HOT 2
- How to workaround using Stack for building html HOT 7
- apparent typo in tutorial under "Testing Values: Booleans and Propositions"
- Can't even get started because of build issues HOT 5
- there is an extra ")" at the end of this line
- Numbering the exercises HOT 1
- Question about Chapter 5.3: delmin HOT 2
- Links to subsections don't work for me HOT 2
- Syntax of refinement types HOT 4
- Chapter 8 exercise "reverse" HOT 8
- Instructions for running LiquidHaskell HOT 2
- Figures 1.4 and 1.5 in Chapter 12
- Chapter 12 Exercise InsertRight HOT 4
- Current HEAD of main fails to build HOT 4
- Liquid Type Mismatch on Initial Build HOT 2
- Passing -fdefer-type-errors to GHC causes confusing errors from LH HOT 3
- Text description of "null" in Chapter 6 is reversed HOT 1
- Link is no longer available HOT 1
- Trouble with Chapter 11 HOT 3
- About Lemmas and other questions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liquidhaskell-tutorial.