Skip to content

Commit

Permalink
Fix inline code with “arr
Browse files Browse the repository at this point in the history
  • Loading branch information
ehamberg committed Aug 17, 2017
1 parent 030a6a6 commit 7078db7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typeclassopedia.md
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@ similar vein to `Monad` and `Applicative`. However, unlike `Monad`
and `Applicative`, whose types only reflect their output, the type of
an `Arrow` computation reflects both its input and output. Arrows
generalize functions: if `arr` is an instance of `Arrow`, a value of
type `b `arr` c` can be thought of as a computation which takes values of
type ``b `arr` c`` can be thought of as a computation which takes values of
type `b` as input, and produces values of type `c` as output. In the
`(->)` instance of `Arrow` this is just a pure function; in general, however,
an arrow may represent some sort of “effectful” computation.
Expand Down Expand Up @@ -1605,7 +1605,7 @@ efficient implementations if desired.
Lets look at each of the arrow methods in turn. [Ross Patersons web page on arrows](http://www.haskell.org/arrows/) has nice diagrams which can help
build intuition.

* The `arr` function takes any function `b -> c` and turns it into a generalized arrow `b `arr` c`. The `arr` method justifies the claim that arrows generalize functions, since it says that we can treat any function as an arrow. It is intended that the arrow `arr g` is pure in the sense that it only computes `g` and has no effects (whatever that might mean for any particular arrow type).
* The `arr` function takes any function `b -> c` and turns it into a generalized arrow ``b `arr` c``. The `arr` method justifies the claim that arrows generalize functions, since it says that we can treat any function as an arrow. It is intended that the arrow `arr g` is pure in the sense that it only computes `g` and has no effects (whatever that might mean for any particular arrow type).

* The `first` method turns any arrow from `b` to `c` into an arrow from `(b,d)` to `(c,d)`. The idea is that `first g` uses `g` to process the first element of a tuple, and lets the second element pass through unchanged. For the function instance of `Arrow`, of course, `first g (x,y) = (g x, y)`.

Expand Down

0 comments on commit 7078db7

Please sign in to comment.