File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ infix 8 ..
135
135
136
136
-- | Create a list containing a range of integers, including both endpoints.
137
137
range :: Int -> Int -> List Int
138
- range start end | start == end = Nil
138
+ range start end | start == end = singleton start
139
139
| otherwise = go end start (if start > end then 1 else -1 ) Nil
140
140
where
141
141
go s e step tail | s == e = (Cons s tail)
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ singleton a = cons a nil
159
159
160
160
-- | Create a list containing a range of integers, including both endpoints.
161
161
range :: Int -> Int -> List Int
162
- range start end | start == end = nil
162
+ range start end | start == end = singleton start
163
163
| otherwise = go end start (if start > end then 1 else -1 ) nil
164
164
where
165
165
go s e step tail | s == e = (cons s tail)
You can’t perform that action at this time.
0 commit comments