From f84ddf092b4f54137a088df949c647877a528749 Mon Sep 17 00:00:00 2001
From: naskya span is kind of like takeWhile, only it returns a pair of lists. The first list contains everything the resulting list from takeWhile would contain if it were called with the same predicate and the same list. The second list contains the part of the list that would have been dropped. Whereas span spans the list while the predicate is true, break breaks it when the predicate is first true. Doing break p is the equivalent of doing span (not . p). Modules
-ghci> let (fw, rest) = span (/=' ') "This is a sentence" in "First word:" ++ fw ++ ", the rest:" ++ rest
+ghci> let (fw, rest) = span (/=' ') "This is a sentence" in "First word: " ++ fw ++ ", the rest:" ++ rest
"First word: This, the rest: is a sentence"
Data.List
contain if it were called with the same predicate and the same list. The
second list contains the part of the list that would have been
dropped.
ghci> let (fw, rest) = span (/=' ') "This is a sentence" in "First word:" ++ fw ++ ", the rest:" ++ rest
+ghci> let (fw, rest) = span (/=' ') "This is a sentence" in "First word: " ++ fw ++ ", the rest:" ++ rest
"First word: This, the rest: is a sentence"
Whereas span
spans the list while the predicate is true,
break
breaks it when the predicate
diff --git a/markdown/source_md/modules.md b/markdown/source_md/modules.md
index afe40b9..9703d1c 100644
--- a/markdown/source_md/modules.md
+++ b/markdown/source_md/modules.md
@@ -277,7 +277,7 @@ The first list contains everything the resulting list from `takeWhile` would con
The second list contains the part of the list that would have been dropped.
```{.haskell:ghci}
-ghci> let (fw, rest) = span (/=' ') "This is a sentence" in "First word:" ++ fw ++ ", the rest:" ++ rest
+ghci> let (fw, rest) = span (/=' ') "This is a sentence" in "First word: " ++ fw ++ ", the rest:" ++ rest
"First word: This, the rest: is a sentence"
```