Comment on Lens: Lenses, Folds and TraversalsparentComments−KPGv21yI still don't know what a monoid is thoughIn short, it's a data type with addition defined. So"a" + "b" = "ab" <-- string and concat is a monoid1 + 5 = 6 <-- nat and natural number addition is a monoid[1] + [2] = [1, 2] <-- list and concat is a monoid*edit* (it also has a zero defined, such as "" or 0 or [])Or an applicativeyou can think of these as "i'd use a functor here via fmap, except my mapping function takes more than one argument"
Comments
In short, it's a data type with addition defined. So
"a" + "b" = "ab" <-- string and concat is a monoid
1 + 5 = 6 <-- nat and natural number addition is a monoid
[1] + [2] = [1, 2] <-- list and concat is a monoid
*edit* (it also has a zero defined, such as "" or 0 or [])
you can think of these as "i'd use a functor here via fmap, except my mapping function takes more than one argument"