From 1c25fab6474c42a9dee6f2d79b4036821283b1b6 Mon Sep 17 00:00:00 2001
From: "Sam A. Horvath-Hunt"
Date: Sun, 30 Aug 2020 18:15:12 +0100
Subject: [PATCH] Fix type in monoid-semigroup
---
published/20200830-monoid-semigroup.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/published/20200830-monoid-semigroup.md b/published/20200830-monoid-semigroup.md
index e1733fe..1e52313 100644
--- a/published/20200830-monoid-semigroup.md
+++ b/published/20200830-monoid-semigroup.md
@@ -68,7 +68,7 @@ const robroy: Cocktail = { name: 'Rob Roy', ingredients: ['scotch', 'bitters'] }
const combined = semigroupCocktail.concat(mojito, robroy);
```
-And just llike that we can combine our types together! Of course, we could just define a function for concatenating these two particular types together without the semigroup formalism, but that’d be both less obvious at a glance to developers familiar with this mathematical terminology, and less likely to be reusable in common abstractions; you’d have to rely upon duck typing and couldn’t rely upon adherence to any laws. Speaking of which, utilising the semigroup type class implies adhering to the law of [associativity](https://en.wikipedia.org/wiki/Associative_property), something common in mathematical and functional abstractions that allows the consumer to make useful assumptions.
+And just like that we can combine our types together! Of course, we could just define a function for concatenating these two particular types together without the semigroup formalism, but that’d be both less obvious at a glance to developers familiar with this mathematical terminology, and less likely to be reusable in common abstractions; you’d have to rely upon duck typing and couldn’t rely upon adherence to any laws. Speaking of which, utilising the semigroup type class implies adhering to the law of [associativity](https://en.wikipedia.org/wiki/Associative_property), something common in mathematical and functional abstractions that allows the consumer to make useful assumptions.
_Fun fact_: If your (attempted) semigroup instance isn’t associative, then it is in actual fact a [magma](https://en.wikipedia.org/wiki/Magma_(algebra))! Although it does exist in the type class hierarchy, it’s exceptionally rare to define a magma that’s not associative thus not also a semigroup.
--
2.43.0