Update 'newtype' article to new math delimiters

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2024-05-13 19:01:08 -07:00
parent a6a330a78e
commit ef76149112

View File

@ -40,7 +40,7 @@ starting with integers.
#### Integers #### Integers
Addition is an associative binary operation. Furthermore, it's well-known that adding zero to a Addition is an associative binary operation. Furthermore, it's well-known 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, 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`. 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 Cool and good. But hey, there are other binary operations on integers! What about
multiplication? It is also associative, and again it is well-known that multiplying multiplication? It is also associative, and again it is well-known 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: `Monoid` instance would be something like the following:
```Haskell ```Haskell