@@ -46,7 +46,7 @@ which happen to be radians.
4646@docs fst, snd
4747
4848# Higher-Order Helpers
49−@docs identity, always, (<|), (|>), (.), flip, curry, uncurry
49+@docs identity, always, (<|), (|>), (<<), (>>), flip, curry, uncurry
5050
5151-}
5252
@@ -316,21 +316,32 @@ isInfinite = Native.Basics.isInfinite
316316
317317-- Function Helpers
318318
319−{-| Function composition. For example, the following code checks if the square
320−root of a number is odd:
319+{-| Function composition, passing results along in the suggested direction. For
320+example, the following code checks if the square root of a number is odd:
321321
322− not . isEven . sqrt
322+ not << isEven << sqrt
323323
324324You can think of this operator as equivalent to the following:
325325
326− (f . g) == (\x -> f (g x))
326+ (g << f) == (\x -> g (f x))
327327
328−So our example is expanding things out to this:
328+So our example expands out to something like this:
329329
330− \number -> not (isEven (sqrt number))
330+ \n -> not (isEven (sqrt n))
331331-}
332−(.) : (b -> c) -> (a -> b) -> (a -> c)
333−(.) f g x = f (g x)
332+(<<) : (b -> c) -> (a -> b) -> (a -> c)
333+(<<) g f x = g (f x)
334+
335+{-| Function composition, passing results along in the suggested direction. For
336+example, the following code checks if the square root of a number is odd:
337+
338+ sqrt >> isEven >> not
339+
340+This direction of function composition seems less pleasant than `(<<)` which
341+reads nicely in expressions like: `filter (not << isRegistered) students`
342+-}
343+(>>) : (a -> b) -> (b -> c) -> (a -> c)
344+(>>) f g x = g (f x)
334345
335346{-| Forward function application `x |> f == f x`. This function is useful
336347for avoiding parenthesis and writing code in a more natural way.
@@ -359,7 +370,8 @@ This can also be written as:
359370(<|) : (a -> b) -> a -> b
360371f <| x = f x
361372
362−infixr 9 .
373+infixr 9 <<
374+infixl 9 >>
363375infixr 0 <|
364376infixl 0 |>
365377