You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Haskell: Int not imported in Abs.hs but needed for position token #296
Will someone please discuss how to resolve the bnfc grammar error i get when I run make after having run bnfc -m --haskell Exp.cf? I'm getting the follow (i) error. If I import Data.Int I just get the error (ii) below it, ad infinitum. Are there any easy resolutions?
(i)
$ make
ghc --make TestExp.hs -o TestExp
[1 of 7] Compiling AbsExp ( AbsExp.hs, AbsExp.o )
AbsExp.hs:13:27: error:
Not in scope: type constructor or class ‘Int’
Perhaps you meant one of these:
‘Data.Int.Int’ (imported from Data.Int),
‘Data.Int.Int8’ (imported from Data.Int)
Perhaps you want to add ‘Int’ to the import list in the import of
‘Prelude’ (AbsExp.hs:8:1-46).
|
13 | newtype AIdent = AIdent ((Int,Int),String)
|
(ii)
$ make
ghc --make TestExp.hs -o TestExp
[1 of 7] Compiling AbsExp ( AbsExp.hs, AbsExp.o )
AbsExp.hs:14:42: error:
• No instance for (IsString ((Int, Int), String))
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
• When deriving the instance for (IsString AIdent)
|
14 | deriving (C.Eq, C.Ord, C.Show, C.Read, Data.String.IsString)
| ^^^^^^^^^^^^^^^^^^^^
changed the title [-]Debug Ex.cf in cubicaltt which, when using `make` improperly requires extra imports[/-][+]Haskell: Int not imported in Abs.hs but needed for position token[/+]on Oct 3, 2020
Activity
andreasabel commentedon Oct 2, 2020
Yes, where?
wmacmil commentedon Oct 2, 2020
https://github.com/mortberg/cubicaltt/blob/master/Exp.cf
sorry i don't know what happened
andreasabel commentedon Oct 3, 2020
This is indeed a regression in BNFC (master), thanks for the report!
Intshould be imported inAbs.hsto accomodate position tokens.I managed to compile cubical with GHC 8.0.2 and BNFC 2.8.3 (latest release).
Let me know if this works.
[-]Debug Ex.cf in cubicaltt which, when using `make` improperly requires extra imports[/-][+]Haskell: Int not imported in Abs.hs but needed for position token[/+]wmacmil commentedon Oct 3, 2020
works for me! tack
[ #296 ] Haskell: fixed regression: import Int in Abs.hs for position…
[ #296 ] Ocaml: handle position tokens
[ #296 ] CPP: fixed a regression for position token
[ #296 ] CPP/Printer: funName was wrong for position tokens
[ #296 ] Haskell/GADT: fixed missing Int import
[ #296 #297 ] position tokens are now tested in #235
andreasabel commentedon Oct 3, 2020
After 173f248, cubicaltt builds again with BNFC-master.
[ testing ] added examples/cubicaltt for backend Haskell