From 26c70980dc9168c75c79623eaad9994aa1f52363 Mon Sep 17 00:00:00 2001 From: Auke Booij Date: Wed, 14 Oct 2015 14:18:01 +0100 Subject: [PATCH] Move to haskell 2010 --- Main.hs | 48 ++++++++++++++++++++++++------------------------ cubicaltt.cabal | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Main.hs b/Main.hs index f36f6ba..d448264 100644 --- a/Main.hs +++ b/Main.hs @@ -128,30 +128,30 @@ loop flags f names tenv = do Left err -> do outputStrLn ("Resolver failed: " ++ err) loop flags f names tenv Right body -> do - x <- liftIO $ TC.runInfer tenv body - case x of - Left err -> do outputStrLn ("Could not type-check: " ++ err) - loop flags f names tenv - Right _ -> do - start <- liftIO getCurrentTime - let e = mod $ E.eval (TC.env tenv) body - - -- Let's not crash if the evaluation raises an error: - liftIO $ catch (putStrLn (msg ++ show e)) - (\e -> putStrLn ("Exception: " ++ - show (e :: SomeException))) - stop <- liftIO getCurrentTime - -- Compute time and print nicely - let time = diffUTCTime stop start - secs = read (takeWhile (/='.') (init (show time))) - rest = read ('0':dropWhile (/='.') (init (show time))) - mins = secs `quot` 60 - sec = printf "%.3f" (fromInteger (secs `rem` 60) + rest :: Float) - when (Time `elem` flags) $ - outputStrLn $ "Time: " ++ show mins ++ "m" ++ sec ++ "s" - -- Only print in seconds: - -- when (Time `elem` flags) $ outputStrLn $ "Time: " ++ show time - loop flags f names tenv + x <- liftIO $ TC.runInfer tenv body + case x of + Left err -> do outputStrLn ("Could not type-check: " ++ err) + loop flags f names tenv + Right _ -> do + start <- liftIO getCurrentTime + let e = mod $ E.eval (TC.env tenv) body + + -- Let's not crash if the evaluation raises an error: + liftIO $ catch (putStrLn (msg ++ show e)) + (\e -> putStrLn ("Exception: " ++ + show (e :: SomeException))) + stop <- liftIO getCurrentTime + -- Compute time and print nicely + let time = diffUTCTime stop start + secs = read (takeWhile (/='.') (init (show time))) + rest = read ('0':dropWhile (/='.') (init (show time))) + mins = secs `quot` 60 + sec = printf "%.3f" (fromInteger (secs `rem` 60) + rest :: Float) + when (Time `elem` flags) $ + outputStrLn $ "Time: " ++ show mins ++ "m" ++ sec ++ "s" + -- Only print in seconds: + -- when (Time `elem` flags) $ outputStrLn $ "Time: " ++ show time + loop flags f names tenv -- (not ok,loaded,already loaded defs) -> to load -> -- (new not ok, new loaded, new defs) diff --git a/cubicaltt.cabal b/cubicaltt.cabal index fee92b7..8452d5d 100644 --- a/cubicaltt.cabal +++ b/cubicaltt.cabal @@ -50,4 +50,4 @@ executable cubical array >=0.5 && <0.6 -- hs-source-dirs: build-tools: alex, happy, bnfc - default-language: Haskell98 + default-language: Haskell2010 -- 2.34.1