aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-02-25 21:04:03 +0100
committerTom Smeding <tom@tomsmeding.com>2024-02-25 21:04:03 +0100
commitc13617684eb10fc622cc502249591002e2f7d74c (patch)
tree1d7171e32f4503817e013133ac56f6d2ea4095ac
parentf72bf16e2edc8d654e661cd59f820409219e5f27 (diff)
Separate out library
-rw-r--r--app/Main.hs (renamed from src/Main.hs)10
-rw-r--r--hie.yaml5
-rw-r--r--hs-visinter.cabal15
3 files changed, 22 insertions, 8 deletions
diff --git a/src/Main.hs b/app/Main.hs
index 750f749..b88d508 100644
--- a/src/Main.hs
+++ b/app/Main.hs
@@ -6,7 +6,7 @@ import Data.List (intersperse)
import System.Environment (getArgs)
import System.Exit (die, exitFailure)
-import Parser
+import HSVIS.Parser
main :: IO ()
@@ -18,11 +18,11 @@ main = do
prog <- case parse fname source of
This errs -> do
- sequence_ $ intersperse (putStrLn "") (map (putStrLn . printErrMsg) errs)
- exitFailure
+ sequence_ $ intersperse (putStrLn "") (map (putStrLn . printErrMsg) errs)
+ exitFailure
These errs res -> do
- sequence_ $ intersperse (putStrLn "") (map (putStrLn . printErrMsg) errs)
- return res
+ sequence_ $ intersperse (putStrLn "") (map (putStrLn . printErrMsg) errs)
+ return res
That res -> return res
print prog
diff --git a/hie.yaml b/hie.yaml
index 9e856b5..ae8c4c0 100644
--- a/hie.yaml
+++ b/hie.yaml
@@ -4,6 +4,11 @@ cradle:
config:
cradle:
cabal:
+ component: "lib:hs-visinter"
+ - path: "./app"
+ config:
+ cradle:
+ cabal:
component: "exe:hs-visinter"
- path: "./examples"
config:
diff --git a/hs-visinter.cabal b/hs-visinter.cabal
index 181d112..748355d 100644
--- a/hs-visinter.cabal
+++ b/hs-visinter.cabal
@@ -7,9 +7,8 @@ author: Tom Smeding
maintainer: tom@tomsmeding.com
build-type: Simple
-executable hs-visinter
- main-is: Main.hs
- other-modules:
+library
+ exposed-modules:
Control.FAlternative
HSVIS.AST
HSVIS.Parser
@@ -23,3 +22,13 @@ executable hs-visinter
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall -threaded
+
+executable hs-visinter
+ main-is: Main.hs
+ other-modules:
+ build-depends:
+ base,
+ hs-visinter
+ hs-source-dirs: app
+ default-language: Haskell2010
+ ghc-options: -Wall -threaded