on master help sign in
Switch record update to use `=` sign

The left arrow `<-` is replaced by `=` Since record extension has no concrete syntax, the equals sign is free. The theory here is that the equals sign will make things more comfortable and uniform. You also will no longer have -> and <- appearing close by in case-expressions anymore.

commit446c7846e7368475a956c2b785e3e62cce94a506 authorEvan Czaplicki <info@elm-lang.org> dateThu 9 Jul 2015, 12:36 (11 years ago) parent779f7aa
2 files changed+3−8
src/Parse/Expression.hs+2−2 src/Parse/Helpers.hs+1−6
src/Parse/Expression.hs+2−2
@@ -151,7 +151,7 @@ recordTerm =
151151 return (E.Update (A.A ann (E.rawVar starter)) fields)
152152
153153 literal (A.A _ starter) =
154− do try (string "<-")
154+ do try equals
155155 whitespace
156156 value <- expr
157157 whitespace
@@ -165,7 +165,7 @@ recordTerm =
165165
166166 field =
167167 do key <- rLabel
168− padded (string "<-")
168+ padded equals
169169 value <- expr
170170 return (key, value)
171171
src/Parse/Helpers.hs+1−6
@@ -137,11 +137,6 @@ rightArrow =
137137 string "->" <|> string "\8594" <?> "->"
138138
139139
140−leftArrow :: IParser String
141−leftArrow =
142− string "<-" <?> "<- for a record update"
143−
144−
145140hasType :: IParser String
146141hasType =
147142 string ":" <?> "the \"has type\" symbol ':'"
@@ -632,6 +627,6 @@ processAs processor s =
632627 , T.opStart = undefined
633628 , T.opLetter = undefined
634629 , T.reservedNames = reserveds
635− , T.reservedOpNames = [":", "->", "<-", "|"]
630+ , T.reservedOpNames = [":", "->", "|"]
636631 , T.caseSensitive = True
637632 }