let-polymorphism working i think???

This commit is contained in:
crumbtoo
2024-03-26 09:23:38 -06:00
parent 93ef870e56
commit 0b4c5e5669
8 changed files with 106 additions and 33 deletions

View File

@@ -10,16 +10,17 @@ import Control.Lens.Combinators
import Core.Lex
import Core.Parse
import Core.SystemF
import GM
--------------------------------------------------------------------------------
driver :: RLPCIO ()
driver = forFiles_ $ \f ->
withSource f (lexCoreR >=> parseCoreProgR >=> undefined >=> evalProgR)
withSource f (lexCoreR >=> parseCoreProgR >=> lintCoreProgR >=> evalProgR)
driverSource :: T.Text -> RLPCIO ()
driverSource = lexCoreR >=> parseCoreProgR
>=> undefined >=> evalProgR >=> printRes
>=> lintCoreProgR >=> evalProgR >=> printRes
where
printRes = liftIO . print . view _1

View File

@@ -78,7 +78,7 @@ respond :: Command -> Response
respond (Annotate s)
= s & (parseRlpProgR >=> typeCheckRlpProgR)
& fmap (\p -> p ^.. funDs
<&> \sc -> serialiseSc (sc & _3 . mapped %~ rout @String))
<&> serialiseSc)
& runRLPCJsonDef
& Annotated
@@ -87,8 +87,7 @@ showPartialAnn = undefined
funDs :: Traversal' (Program b a) (b, [Pat b], a)
funDs = programDecls . each . _FunD
serialiseSc :: ToJSON a
=> (PsName, [Pat PsName], Cofree (RlpExprF PsName) a)
serialiseSc :: (PsName, [Pat PsName], Cofree (RlpExprF PsName) (Type PsName))
-> Value
serialiseSc (n,as,e) = object
[ "name" .= n