From cc3b4084bc328023b20cdf14ea6e9be1f86d940c Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Tue, 14 Sep 2021 14:45:50 +0200 Subject: Fix typo in haskell/composition --- haskell/composition.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'haskell/composition.html') diff --git a/haskell/composition.html b/haskell/composition.html index d1d4afc..1d3d013 100644 --- a/haskell/composition.html +++ b/haskell/composition.html @@ -123,7 +123,7 @@ This is exactly like you may have learned that subtraction is left-associative ( (.) :: (b -> c) -> (a -> b) -> (a -> c) (.) :: (b -> c) -> ((a -> b) -> (a -> c)) -

(Why can't we remove the parentheses around the b -> c and a -> c in there? That is because it the type would then suddenly mean something different. Try to work that out for yourself!)

+

(Why can't we remove the parentheses around the b -> c and a -> b in there? That is because it the type would then suddenly mean something different. Try to work that out for yourself!)

We can read this as: (.) takes a function g :: b -> c, a function f :: a -> b and a value x :: a. It applies f to x, applies g to the result, and returns the result of that. Indeed, (.) can be implemented like this:

-- cgit v1.2.3-70-g09d2