Skip to content
Snippets Groups Projects
Commit 26c0ea8c authored by Joris ten Tusscher's avatar Joris ten Tusscher
Browse files

Fixed bug that caused model returned by the web server to be empty.

parent 14ecbbaa
No related branches found
No related tags found
No related merge requests found
......@@ -99,8 +99,11 @@ sanitize model =
-- | Exclude model's variables that are not actual input arguments.
minify :: TypeEnv -> Model -> Model
minify typeEnv = M.filterWithKey (\k _ -> k `elem` vars)
minify typeEnv = M.filterWithKey (\k _ -> (name k) `elem` vars)
where vars = concatMap (\(Name ids, _) -> (\(Ident s) -> s) <$> ids) typeEnv
-- `vars` is a list of var names, but the keys in the Map have names
-- formatted as "<name>:<type>".
name = fst . span (\x -> x /= ':')
-- | Parsers.
modelP :: Parser ModelVal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment