Skip to content

Haskell: Int not imported in Abs.hs but needed for position token #296

Closed

Description

@wmacmil

Am trying to just compile the cubicaltt file in

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)
| ^^^^^^^^^^^^^^^^^^^^

Activity

  1. andreasabel commented on Oct 2, 2020

    @andreasabel
    Member

    Am trying to just compile the cubicaltt file in

    Yes, where?

  2. andreasabel commented on Oct 3, 2020

    @andreasabel
    Member

    This is indeed a regression in BNFC (master), thanks for the report!
    Int should be imported in Abs.hs to accomodate position tokens.

    I managed to compile cubical with GHC 8.0.2 and BNFC 2.8.3 (latest release).

    cabal install --program-suffix=-2.8.3 BNFC-2.8.3
    cd cubicaltt
    rm -rf Exp
    BNFC=bnfc-2.8.3 make -f GNUmakefile
    

    Let me know if this works.

  3. added this to the 2.8.4 milestone on Oct 3, 2020
  4. self-assigned this
    on Oct 3, 2020
  5. 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
  6. wmacmil commented on Oct 3, 2020

    @wmacmil
    Author

    works for me! tack

  7. added 6 commits that reference this issue on Oct 3, 2020
  8. andreasabel commented on Oct 3, 2020

    @andreasabel
    Member

    After 173f248, cubicaltt builds again with BNFC-master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions