Update 'newtype' article to new math delimiters
Signedoffby: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
parent
a6a330a78e
commit
ef76149112

@ 40,7 +40,7 @@ starting with integers.




#### Integers


Addition is an associative binary operation. Furthermore, it's wellknown that adding zero to a


number leaves that number intact: \\(0+n = n + 0 = n\\). So we might define a `Monoid` instance for


number leaves that number intact: \(0+n = n + 0 = n\). So we might define a `Monoid` instance for


numbers as follows. Note that we actually provide `(<>)` via the `Semigroup` class,


which _just_ requires the associative binary operation, and serves as a superclass for `Monoid`.





@ 54,7 +54,7 @@ instance Monoid Int where




Cool and good. But hey, there are other binary operations on integers! What about


multiplication? It is also associative, and again it is wellknown that multiplying


anything by one leaves that number as it was: \\(1\*n = n\*1 = n\\). The corresponding


anything by one leaves that number as it was: \(1\*n = n\*1 = n\). The corresponding


`Monoid` instance would be something like the following:




```Haskell




Loading…
Reference in New Issue
Block a user