aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compcomp.cabal36
-rw-r--r--main/Main.hs8
2 files changed, 19 insertions, 25 deletions
diff --git a/compcomp.cabal b/compcomp.cabal
index 20a3d37..c849954 100644
--- a/compcomp.cabal
+++ b/compcomp.cabal
@@ -1,47 +1,41 @@
+cabal-version: 2.2
name: compcomp
version: 0.1.0
-cabal-version: >= 1.10
build-type: Simple
license: MIT
author: Tom Smeding
maintainer: tom.smeding@gmail.com
+common deps
+ default-language: Haskell2010
+ ghc-options: -O2 -Wall
+ build-depends: base >=4.13 && <4.14
+
executable compcomp
+ import: deps
hs-source-dirs: main
main-is: Main.hs
- default-language: Haskell2010
- ghc-options: -Wall -O2
- build-depends: base >= 4 && < 5, cc-parser, cc-typecheck, cc-utils
- other-modules:
+ build-depends: cc-parser, cc-typecheck, cc-utils
library cc-parser
+ import: deps
hs-source-dirs: parser
- default-language: Haskell2010
- ghc-options: -Wall -O2
- build-depends: base >= 4 && < 5, parsec, cc-ast, cc-utils
+ build-depends: parsec, cc-ast, cc-utils
exposed-modules: CC.Parser
- other-modules:
library cc-typecheck
+ import: deps
hs-source-dirs: typecheck
- default-language: Haskell2010
- ghc-options: -Wall -O2
- build-depends: base >= 4 && < 5, containers, mtl, cc-ast, cc-utils
+ build-depends: containers, mtl, cc-ast, cc-utils
exposed-modules: CC.Typecheck
- other-modules:
library cc-ast
+ import: deps
hs-source-dirs: ast
- default-language: Haskell2010
- ghc-options: -Wall -O2
- build-depends: base >= 4 && < 5, cc-utils
+ build-depends: cc-utils
exposed-modules: CC.Source, CC.Typed
- other-modules:
library cc-utils
+ import: deps
hs-source-dirs: utils
- default-language: Haskell2010
- ghc-options: -Wall -O2
- build-depends: base >= 4 && < 5
exposed-modules: CC.Types, CC.Pretty
- other-modules:
diff --git a/main/Main.hs b/main/Main.hs
index 3216833..dbac4c4 100644
--- a/main/Main.hs
+++ b/main/Main.hs
@@ -2,8 +2,8 @@ module Main where
import System.Exit
-import qualified CC.Parser
-import qualified CC.Typecheck
+import qualified CC.Parser as Parser
+import qualified CC.Typecheck as Typecheck
import CC.Pretty
import CC.Types
@@ -23,8 +23,8 @@ passJoin f1 f2 ctx a = f1 ctx a >>= f2 ctx
main :: IO ()
main = do
- let parse = pass CC.Parser.runPass
- typecheck = pass CC.Typecheck.runPass
+ let parse = pass Parser.runPass
+ typecheck = pass Typecheck.runPass
let combined = parse `passJoin` typecheck