on master help sign in
Merge pull request #1372 from elm-lang/dev

Bring in minor changes

commit3a438880d6dd8edf9c2dfc82b1831b48aeb86603 authorEvan Czaplicki <info@elm-lang.org> dateThu 12 May 2016, 14:58 (10 years ago) parentc9c7e72b2be9f3
2 files changed+7−12
hints/recursive-alias.md+3−3 src/Reporting/Error/Helpers.hs+4−9
hints/recursive-alias.md+3−3
@@ -89,7 +89,7 @@ No matter what, the type of `Node n xs` is going to be `List`. There is no expan
8989So let's return to wanting to represent a `Comment` that may have responses. There are a couple ways to do this:
9090
9191
92−### Obvious, but kind of annoying
92+### Obvious, but kind of annoying
9393
9494```elm
9595type Comment =
@@ -133,7 +133,7 @@ upvote comment =
133133 { comment | upvotes = 1 + comment.upvotes }
134134```
135135
136−So rather than having to unwrap a `Comment` to do *anything* to it, you only have to do some unwrapping in the cases where you are doing something recusive. In practice, this means you will do less unwrapping which is nice.
136+So rather than having to unwrap a `Comment` to do *anything* to it, you only have to do some unwrapping in the cases where you are doing something recursive. In practice, this means you will do less unwrapping which is nice.
137137
138138
139139## Mutually recursive type aliases
@@ -158,4 +158,4 @@ type SortBy = Time | Score | MostResponses
158158
159159When you try to expand `Comment` you have to expand `Responses` which needs to expand `Comment` which needs to expand `Responses`, etc.
160160
161−So this is just a fancy case of a self-recusive type alias. The solution is the same. Somewhere in that cycle, you need to define an actual `type` to end the infinite expansion.
161+So this is just a fancy case of a self-recursive type alias. The solution is the same. Somewhere in that cycle, you need to define an actual `type` to end the infinite expansion.
src/Reporting/Error/Helpers.hs+4−9
@@ -114,23 +114,18 @@ drawCycle :: [String] -> Doc
114114drawCycle strings =
115115 let
116116 topLine =
117− [ text "┌─────┐"
118− , text "│ V"
119− ]
117+ text "┌─────┐"
120118
121119 line str =
122− [ text "│ " <> dullyellow (text str)
123− ]
120+ text "│ " <> dullyellow (text str)
124121
125122 midLine =
126− [ text "│ │"
127− , text "│ V"
128− ]
123+ text "│ ↓"
129124
130125 bottomLine =
131126 text "└─────┘"
132127 in
133− vcat (topLine ++ List.intercalate midLine (map line strings) ++ [ bottomLine ])
128+ vcat (topLine : List.intersperse midLine (map line strings) ++ [ bottomLine ])
134129
135130
136131