Fix prelude
This commit is contained in:
parent
3729278041
commit
e42c775135
1 changed files with 44 additions and 44 deletions
36
src/Main.hs
36
src/Main.hs
|
|
@ -18,27 +18,18 @@ 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)
|
||||
|
|
@ -166,4 +157,13 @@ printToErr = hPutStrLn stderr
|
|||
fromErr :: Err a -> IO a
|
||||
fromErr = either (\s -> printToErr s >> exitFailure) pure
|
||||
|
||||
prelude = "\n\nconst 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)"
|
||||
prelude :: String
|
||||
prelude = unlines
|
||||
[ "\n"
|
||||
, "const : a -> b -> a"
|
||||
, "data Bool () where"
|
||||
, " False : Bool ()"
|
||||
, " True : Bool ()"
|
||||
, "lt : Int -> Int -> Bool ()"
|
||||
, "lt x y = const True (x + y)"
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue