on master help sign in
Take ports out of MetadataModule, where it is no longer needed
commit96f55fceab802a1517dbbf1b7294e8408f845b66 authorEvan Czaplicki <info@elm-lang.org> dateMon 6 Jan 2014, 08:06 (13 years ago) parentda033e3
4 files changed+2−15
compiler/Build/Source.hs−2 compiler/SourceSyntax/Module.hs−2 compiler/Transform/Canonicalize.hs+1−6 compiler/Transform/SafeNames.hs+1−5
compiler/Build/Source.hs−2
@@ -51,8 +51,6 @@ build noPrelude interfaces source =
5151 , datatypes = [ (name,vars,ctors,ds) | Datatype name vars ctors ds <- decls ]
5252 , fixities = [ (assoc,level,op) | Fixity assoc level op <- decls ]
5353 , aliases = [ (name,tvs,tipe,ds) | TypeAlias name tvs tipe ds <- decls ]
54− , sendPorts = [ (name,expr,tipe) | Port (Send name expr tipe) <- decls ]
55− , recvPorts = [ (name,expr,tipe) | Port (Recv name expr tipe) <- decls ]
5654 }
5755
5856 types <- TI.infer interfaces metaModule
compiler/SourceSyntax/Module.hs−2
@@ -47,8 +47,6 @@ data MetadataModule =
4747 , fixities :: [(Assoc, Int, String)]
4848 , aliases :: [Alias]
4949 , datatypes :: [ADT]
50− , sendPorts :: [(String, LExpr, Type)]
51− , recvPorts :: [(String, LExpr, Type)]
5250 } deriving Show
5351
5452type Interfaces = Map.Map String ModuleInterface
compiler/Transform/Canonicalize.hs+1−6
@@ -58,16 +58,11 @@ metadataModule ifaces modul =
5858 program' <- rename initialEnv (program modul)
5959 aliases' <- mapM (three4 renameType') (aliases modul)
6060 datatypes' <- mapM (three4 (mapM (two2 (mapM renameType')))) (datatypes modul)
61− sendPorts' <- mapM renamePort (sendPorts modul)
62− recvPorts' <- mapM renamePort (recvPorts modul)
6361 return $ modul { program = program'
6462 , aliases = aliases'
65− , datatypes = datatypes'
66− , sendPorts = sendPorts'
67− , recvPorts = recvPorts' }
63+ , datatypes = datatypes' }
6864 where
6965 two2 f (a,b) = (,) a <$> f b
70− renamePort (name,expr,tipe) = (,,) name <$> rename initialEnv expr <*> renameType' tipe
7166 three4 f (a,b,c,d) = (,,,) a b <$> f c <*> return d
7267 renameType' =
7368 Either.either (\err -> Left [P.text err]) return . renameType (replace "type" initialEnv)
compiler/Transform/SafeNames.hs+1−5
@@ -69,8 +69,4 @@ metadataModule modul =
6969 , datatypes =
7070 let makeSafe (name,tvars,ctors,ds) = (var name, tvars, map (first var) ctors, ds)
7171 in map makeSafe (datatypes modul)
72− , sendPorts = map safePorts (sendPorts modul)
73− , recvPorts = map safePorts (recvPorts modul)
74− }
75− where
76− safePorts (name,expr,tipe) = (name, expression expr, tipe)
72+ }