aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Eval.hs
diff options
context:
space:
mode:
authorMarvin Borner2024-09-05 15:34:20 +0200
committerMarvin Borner2024-09-06 14:46:03 +0200
commitc95688c2fa63ba91df518ddf0d97261d6bd02426 (patch)
tree0c548056289d7551243dd73cb585f54d179403d1 /src/Eval.hs
parentb565350fb5f44f57dcb02a66ae99bab3b27313d3 (diff)
Refactored Helper.hs
Diffstat (limited to 'src/Eval.hs')
-rw-r--r--src/Eval.hs20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/Eval.hs b/src/Eval.hs
index 548b43a..9b204ea 100644
--- a/src/Eval.hs
+++ b/src/Eval.hs
@@ -3,7 +3,6 @@ module Eval
( evalMain
) where
-import Binary
import Control.Concurrent
import Control.DeepSeq ( deepseq )
import Control.Exception
@@ -18,11 +17,7 @@ import Data.List
import qualified Data.Map as M
import Data.Maybe
import Data.Time.Clock
-import Helper
-import Optimizer
-import Parser
import Paths_bruijn
-import Reducer
import System.Clock
import System.Console.Haskeline
import System.Directory
@@ -35,6 +30,16 @@ import Text.Megaparsec hiding ( State
, try
)
+import Binary
+import Config
+import Conversion
+import Error
+import Helper
+import Humanification
+import Optimizer
+import Parser
+import Reducer
+
data EnvState = EnvState
{ _env :: Environment
, _conf :: EvalConf
@@ -217,8 +222,8 @@ evalCommand inp s@(EnvState env@(Environment envDefs) conf cache) = \case
Watch path ->
let
monitor mtime = do
- threadDelay 100000
- full <- fullPath "" path
+ threadDelay 100000 -- TODO: fix watch
+ full <- fullPath (_path conf) path
t <- getModificationTime full
if t > mtime
then
@@ -237,7 +242,6 @@ evalCommand inp s@(EnvState env@(Environment envDefs) conf cache) = \case
>> pure s
else if M.member path (_imported cache)
then -- load from cache
-
let
(Environment env') = fromJust $ M.lookup path (_imported cache)
prefix | null namespace = takeBaseName path ++ "."