0

I tried "stack install megaparsec", adding megaparsec and parsec as a dependency in the project.yaml file and running stack build, i tried stack build on all levels of the project folder. Also what's weird is that I can load the module which contains the imports which are marked as problems by VSCode and show the error message and I can also run the functions in said module which make us of the imported stuff but I can't compile the file.

ghci version is 9.0.1

stack version is 2.7.3

cabal-version: 1.12

Error message from terminal

module Parsing where

import Control.Monad (void)
import Data.Void
import Syntax
import Data.Text (Text)

vvvvv these 3 are marked as problems and are the reason I can't compile the file.

import Text.Megaparsec 
import Text.Megaparsec.Char
import qualified Text.Megaparsec.Char.Lexer as L  

.cabal file

library
  exposed-modules:
      Example
      Lib
      Parsing
      Print
      Semantics
      Syntax
  other-modules:
      Paths_parser
  hs-source-dirs:
      src
  build-depends:
      base >=4.7 && <5
    , containers
    , megaparsec
    , parsec
    , text
  default-language: Haskell2010

executable parser-exe
  main-is: Main.hs
  other-modules:
      Paths_parser
  hs-source-dirs:
      app
  ghc-options: -threaded -rtsopts -with-rtsopts=-N
  build-depends:
      base >=4.7 && <5
    , parser
  default-language: Haskell2010

test-suite parser-test
  type: exitcode-stdio-1.0
  main-is: Spec.hs
  other-modules:
      Paths_parser
  hs-source-dirs:
      test
  ghc-options: -threaded -rtsopts -with-rtsopts=-N
  build-depends:
      base >=4.7 && <5
    , parser
  default-language: Haskell2010

0 Answers0