1
1
mirror of https://github.com/github/semantic.git synced 2024-12-28 01:11:52 +03:00

Little formatting/cleanup for clarity

This commit is contained in:
Timothy Clem 2018-03-23 09:04:11 -07:00
parent 8c90975a48
commit fb43de8fce

View File

@ -364,17 +364,16 @@ instance Evaluatable Namespace where
eval Namespace{..} = go names
where
names = toList (freeVariables (subterm namespaceName))
go [] = fail "expected at least one free variable in namespaceName, found none"
go [name] = letrec' name $ \addr -> do
go [name] = letrec' name $ \addr ->
subtermValue namespaceBody *> makeNamespace name addr
go (name:xs) = letrec' name $ \addr ->
go xs <* makeNamespace name addr
makeNamespace name addr = do
namespaceEnv <- Env.head <$> getEnv
v <- namespace name namespaceEnv
assign addr v
pure v
v <$ assign addr v
letrec' name body = do
addr <- lookupOrAlloc name
v <- localEnv id (body addr)