@@ -2,16 +2,14 @@
22module Transform.Expression (crawlLet, checkPorts) where
33
44import Control.Applicative ((<$>),(<*>))
5−import Data.Traversable (traverse)
65import SourceSyntax.Expression
76import SourceSyntax.Location
87import qualified SourceSyntax.Type as ST
9−import qualified Type.Type as TT
108
119crawlLet :: ([def] -> Either a [def']) -> LExpr' def -> Either a (LExpr' def')
12−crawlLet = crawl (\_ _ _ -> return ()) (\_ _ -> return ())
10+crawlLet = crawl (\_ _ -> return ()) (\_ _ -> return ())
1311
14−checkPorts :: (String -> ST.Type -> TT.Variable -> Either a ())
12+checkPorts :: (String -> ST.Type -> Either a ())
1513 -> (String -> ST.Type -> Either a ())
1614 -> LExpr
1715 -> Either a LExpr
@@ -22,7 +20,7 @@ checkPorts inCheck outCheck expr =
2220 do _ <- checkPorts inCheck outCheck body
2321 return def
2422
25−crawl :: (String -> ST.Type -> TT.Variable -> Either a ())
23+crawl :: (String -> ST.Type -> Either a ())
2624 -> (String -> ST.Type -> Either a ())
2725 -> ([def] -> Either a [def'])
2826 -> LExpr' def
@@ -49,9 +47,9 @@ crawl portInCheck portOutCheck defsTransform = go
4947 Record fields -> Record <$> mapM (\(k,v) -> (,) k <$> go v) fields
5048 Markdown uid md es -> Markdown uid md <$> mapM go es
5149 Let defs body -> Let <$> defsTransform defs <*> go body
52− PortIn name st tt handler ->
53− do portInCheck name st tt
54− PortIn name st tt <$> traverse go handler
50+ PortIn name st ->
51+ do portInCheck name st
52+ return $ PortIn name st
5553 PortOut name st signal ->
5654 do portOutCheck name st
5755 PortOut name st <$> go signal