extremely basic Rlp2Core
This commit is contained in:
@@ -13,6 +13,7 @@ module Compiler.JustRun
|
||||
, justParseRlp
|
||||
, justTypeCheckCore
|
||||
, justHdbg
|
||||
, justInferRlp
|
||||
, makeItPretty, makeItPretty'
|
||||
)
|
||||
where
|
||||
@@ -35,6 +36,7 @@ import Data.Pretty
|
||||
|
||||
import Rlp.AltParse
|
||||
import Rlp.AltSyntax qualified as Rlp
|
||||
import Rlp.HindleyMilner
|
||||
----------------------------------------------------------------------------------
|
||||
|
||||
justHdbg :: String -> IO GmState
|
||||
@@ -65,6 +67,12 @@ justTypeCheckCore s = typechk (T.pack s)
|
||||
& rlpcToEither
|
||||
where typechk = lexCoreR >=> parseCoreProgR >=> checkCoreProgR
|
||||
|
||||
justInferRlp :: String
|
||||
-> Either [MsgEnvelope RlpcError]
|
||||
(Rlp.Program Rlp.PsName Rlp.TypedRlpExpr')
|
||||
justInferRlp s = infr (T.pack s) & rlpcToEither
|
||||
where infr = parseRlpProgR >=> typeCheckRlpProgR
|
||||
|
||||
makeItPretty :: (Out a) => Either e a -> Either e (Doc ann)
|
||||
makeItPretty = fmap out
|
||||
|
||||
|
||||
Reference in New Issue
Block a user