Skip to content

Commit

Permalink
Fix documentation for break (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Menschenkindlein authored and abadi199 committed Nov 10, 2016
1 parent 5b53f01 commit 3802c45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/List/Extra.elm
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ dropWhileRight p =
[]


{-| Take a predicate and a list, return a tuple. The first part of the tuple is longest prefix of that list, for each element of which the predicate holds. The second part of the tuple is the remainder of the list. `span p xs` is equivalent to `(takeWhile p xs, dropWhile p xs)`.
{-| Take a predicate and a list, return a tuple. The first part of the tuple is the longest prefix of that list, for each element of which the predicate holds. The second part of the tuple is the remainder of the list. `span p xs` is equivalent to `(takeWhile p xs, dropWhile p xs)`.
span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4])
span (< 5) [1,2,3] == ([1,2,3],[])
Expand All @@ -928,7 +928,7 @@ span p xs =
( takeWhile p xs, dropWhile p xs )


{-| Take a predicate and a list, return a tuple. The first part of the tuple is longest prefix of that list, for each element of which the predicate *does not* hold. The second part of the tuple is the remainder of the list. `span p xs` is equivalent to `(dropWhile p xs, takeWhile p xs)`.
{-| Take a predicate and a list, return a tuple. The first part of the tuple is the longest prefix of that list, for each element of which the predicate *does not* hold. The second part of the tuple is the remainder of the list. `break p xs` is equivalent to `(takeWhile (not p) xs, dropWhile (not p) xs)`.
break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
break (< 5) [1,2,3] == ([],[1,2,3])
Expand Down

0 comments on commit 3802c45

Please sign in to comment.