Skip to content

Commit

Permalink
Fix issue 162: Let expressions would re-order its members such that f…
Browse files Browse the repository at this point in the history
…unctions always came after values. This meant that you could not use the functions to define any values within a let.
  • Loading branch information
process-bot committed May 28, 2013
1 parent ea0b6c3 commit 22042e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Elm.cabal
@@ -1,5 +1,5 @@
Name: Elm
Version: 0.8.0.2
Version: 0.8.0.3
Synopsis: The Elm language module.
Description: Elm aims to make client-side web-development more pleasant.
It is a statically/strongly typed, functional reactive
Expand Down
3 changes: 2 additions & 1 deletion compiler/Gen/CompileToJS.hs
Expand Up @@ -272,7 +272,8 @@ jsLet defs e' = do ds <- jsDefs defs
where
jsDefs defs = mapM toJS (sortBy f defs)
f a b = compare (valueOf a) (valueOf b)
valueOf (FnDef _ args _) = min 1 (length args)
valueOf (FnDef _ [] _) = 2
valueOf (FnDef _ _ _) = 1
valueOf (OpDef _ _ _ _) = 1

caseToJS span e ps = do
Expand Down

0 comments on commit 22042e2

Please sign in to comment.