let-polymorphism working i think???
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user