Fix issue 162: Let expressions would re-order its members such that functions always came after values. This meant that you could not use the functions to define any values within a let.
commit22042e29677d39155c841be5943370c8450255f7
authorevancz <info@elm-lang.org>
dateTue 28 May 2013, 07:06 (13 years ago)
parentea0b6c3
Elm.cabal+1−1
@@ -1,5 +1,5 @@
11Name: Elm
2−Version: 0.8.0.2
2+Version: 0.8.0.3
33Synopsis: The Elm language module.
44Description: Elm aims to make client-side web-development more pleasant.
55 It is a statically/strongly typed, functional reactive
compiler/Gen/CompileToJS.hs+2−1
@@ -272,7 +272,8 @@ jsLet defs e' = do ds <- jsDefs defs
272272 where
273273 jsDefs defs = mapM toJS (sortBy f defs)
274274 f a b = compare (valueOf a) (valueOf b)
275− valueOf (FnDef _ args _) = min 1 (length args)
275+ valueOf (FnDef _ [] _) = 2
276+ valueOf (FnDef _ _ _) = 1
276277 valueOf (OpDef _ _ _ _) = 1
277278
278279caseToJS span e ps = do