Skip to content

Commit c058610

Browse files
committed
Fix stray "degrees" mention from old example
1 parent 29efb12 commit c058610

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Basics.elm

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -842,25 +842,26 @@ composeR f g x =
842842
{-| Saying `x |> f` is exactly the same as `f x`.
843843
844844
It is called the “pipe” operator because it lets you write “pipelined” code.
845-
For example, say we have a `sanitize` function for turning user input in
846-
degrees into integers. We can rewrite it like this:
847-
848-
import Maybe
845+
For example, say we have a `sanitize` function for turning user input into
846+
integers:
849847
850848
-- BEFORE
851849
sanitize : String -> Maybe Int
852850
sanitize input =
853851
String.toInt (String.trim input)
854852
853+
We can rewrite it like this:
854+
855855
-- AFTER
856856
sanitize : String -> Maybe Int
857857
sanitize input =
858858
input
859859
|> String.trim
860860
|> String.toInt
861861
862-
To get a better intuition, I recommend trying to rewrite code that uses `x |> f`
863-
into code like `f x` until there are no pipes left.
862+
Totally equivalent! I recommend trying to rewrite code that uses `x |> f`
863+
into code like `f x` until there are no pipes left. That can help you build
864+
your intuition.
864865
865866
**Note:** This can be overused! I think folks find it quite neat, but when you
866867
have three or four steps, the code often gets clearer if you break out a

0 commit comments

Comments
 (0)