shitty temp frontend
This commit is contained in:
@@ -88,11 +88,11 @@ corePrelude = Module (Just ("Prelude", [])) $ Program
|
||||
, ScDef "k" ["x", "y"] $ "x"
|
||||
, ScDef "k1" ["x", "y"] $ "y"
|
||||
, ScDef "succ" ["f", "g", "x"] $ "f" :$ "x" :$ ("g" :$ "x")
|
||||
, ScDef "compose" ["f", "g", "x"] "f" :$ ("g" :$ "x")
|
||||
, ScDef "compose" ["f", "g", "x"] $ "f" :$ ("g" :$ "x")
|
||||
, ScDef "twice" ["f", "x"] $ "f" :$ ("f" :$ "x")
|
||||
, ScDef "False" [] $ Con 0 0
|
||||
, ScDef "True" [] $ Con 1 0
|
||||
, ScDef "MkPair" [] $ Con 1 2
|
||||
, ScDef "MkPair" [] $ Con 0 2
|
||||
, ScDef "fst" ["p"] $ "casePair#" :$ "p" :$ "k"
|
||||
, ScDef "snd" ["p"] $ "casePair#" :$ "p" :$ "k1"
|
||||
]
|
||||
|
||||
@@ -16,6 +16,7 @@ import Data.Foldable (foldl')
|
||||
import Core.Syntax
|
||||
import Core.Lex
|
||||
import Compiler.RLPC
|
||||
import Data.Default.Class (def)
|
||||
}
|
||||
|
||||
%name parseCore Module
|
||||
@@ -152,7 +153,7 @@ parseTmp = do
|
||||
Left e -> error (show e)
|
||||
Right (ts,_) -> pure ts
|
||||
where
|
||||
parse = evalRLPC RLPCOptions . (lexCore >=> parseCore)
|
||||
parse = evalRLPC def . (lexCore >=> parseCore)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import Language.Haskell.TH.Syntax hiding (Module)
|
||||
import Language.Haskell.TH.Quote
|
||||
import Control.Monad ((>=>))
|
||||
import Compiler.RLPC
|
||||
import Data.Default.Class (def)
|
||||
import Core.Parse
|
||||
import Core.Lex
|
||||
----------------------------------------------------------------------------------
|
||||
@@ -43,19 +44,19 @@ qCore s = case parse s of
|
||||
Left e -> error (show e)
|
||||
Right (m,ts) -> lift m
|
||||
where
|
||||
parse = evalRLPC RLPCOptions . (lexCore >=> parseCore)
|
||||
parse = evalRLPC def . (lexCore >=> parseCore)
|
||||
|
||||
qCoreExpr :: String -> Q Exp
|
||||
qCoreExpr s = case parseExpr s of
|
||||
Left e -> error (show e)
|
||||
Right (m,ts) -> lift m
|
||||
where
|
||||
parseExpr = evalRLPC RLPCOptions . (lexCore >=> parseCoreExpr)
|
||||
parseExpr = evalRLPC def . (lexCore >=> parseCoreExpr)
|
||||
|
||||
qCoreProg :: String -> Q Exp
|
||||
qCoreProg s = case parseProg s of
|
||||
Left e -> error (show e)
|
||||
Right (m,ts) -> lift m
|
||||
where
|
||||
parseProg = evalRLPC RLPCOptions . (lexCore >=> parseCoreProg)
|
||||
parseProg = evalRLPC def . (lexCore >=> parseCoreProg)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user