introduced lt in prelude
This commit is contained in:
parent
2cb8527848
commit
fd418faa5f
1 changed files with 83 additions and 72 deletions
33
src/Main.hs
33
src/Main.hs
|
|
@ -1,6 +1,5 @@
|
|||
{-# LANGUAGE OverloadedRecordDot #-}
|
||||
|
||||
|
||||
module Main where
|
||||
|
||||
import AnnForall (annotateForall)
|
||||
|
|
@ -19,18 +18,27 @@ import LambdaLifter (lambdaLift)
|
|||
import Monomorphizer.Monomorphizer (monomorphize)
|
||||
import Renamer.Renamer (rename)
|
||||
import ReportForall (reportForall)
|
||||
import System.Console.GetOpt (ArgDescr (NoArg, ReqArg),
|
||||
import System.Console.GetOpt (
|
||||
ArgDescr (NoArg, ReqArg),
|
||||
ArgOrder (RequireOrder),
|
||||
OptDescr (Option), getOpt,
|
||||
usageInfo)
|
||||
import System.Directory (createDirectory, doesPathExist,
|
||||
OptDescr (Option),
|
||||
getOpt,
|
||||
usageInfo,
|
||||
)
|
||||
import System.Directory (
|
||||
createDirectory,
|
||||
doesPathExist,
|
||||
getDirectoryContents,
|
||||
removeDirectoryRecursive,
|
||||
setCurrentDirectory)
|
||||
setCurrentDirectory,
|
||||
)
|
||||
import System.Environment (getArgs)
|
||||
import System.Exit (ExitCode (ExitFailure),
|
||||
exitFailure, exitSuccess,
|
||||
exitWith)
|
||||
import System.Exit (
|
||||
ExitCode (ExitFailure),
|
||||
exitFailure,
|
||||
exitSuccess,
|
||||
exitWith,
|
||||
)
|
||||
import System.IO (stderr)
|
||||
import System.Process (spawnCommand, waitForProcess)
|
||||
import TypeChecker.TypeChecker (TypeChecker (Bi, Hm), typecheck)
|
||||
|
|
@ -93,11 +101,12 @@ main' opts s =
|
|||
let
|
||||
log :: (Print a, Show a) => a -> IO ()
|
||||
log = printToErr . if opts.debug then show else printTree
|
||||
in do
|
||||
in
|
||||
do
|
||||
file <- readFile s
|
||||
|
||||
printToErr "-- Parse Tree -- "
|
||||
parsed <- fromErr . pProgram . resolveLayout True $ myLexer file
|
||||
parsed <- fromErr . pProgram . resolveLayout True $ myLexer (file ++ prelude)
|
||||
log parsed
|
||||
|
||||
printToErr "-- Desugar --"
|
||||
|
|
@ -156,3 +165,5 @@ printToErr = hPutStrLn stderr
|
|||
|
||||
fromErr :: Err a -> IO a
|
||||
fromErr = either (\s -> printToErr s >> exitFailure) pure
|
||||
|
||||
prelude = "const x y = x\n\ndata Bool () where\n True : Bool ()\n False : Bool ()\n\nlt : Int -> Int -> Bool ()\nlt = \\x. \\y. const True (x + y)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue