Problem with parser generated by bnfc
wmacmil opened this issue · 4 comments
Will 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 error. If I import Data.Int I just get the error below it, ad infinitum. Are there any easy resolutions
$ 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)
|
wmacmil@w:~/bnfc/cubicalTT$ 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)
| ^^^^^^^^^^^^^^^^^^^^
I have never seen this problem before, but probably it has to do with BNFC and not cubicaltt? Maybe you can ask your question over at https://github.com/BNFC/bnfc instead?
Tack for the advice - Andreas recognized that it's a regression in BNFC - perhaps this should be pointed out in the README?
Tack for the advice - Andreas recognized that it's a regression in BNFC - perhaps this should be pointed out in the README?
Tack for the advice - Andreas recognized that it's a regression in BNFC - perhaps this should be pointed out in the README?
Great that it worked out! Feel free to make a PR updating the README.
Btw, I don't think many people (if anyone) are using cubicaltt anymore now that we have Cubical Agda.