Re:Frege: A Haskell-Like Language for the JVM
by whateveracct on Thursday August 13, 2015 @07:33PM
(#10057823)
Not quite ;) Semigroups are defined by their associative, binary operator of type a -> a -> a. Monoids are that plus an identity value of a.
[ Parent
| on HN ]
Re:Frege: A Haskell-Like Language for the JVM
by rarepostinlurkr on Monday August 17, 2015 @12:42AM
(#10071401)
There Haskell people go again =) You try to define something in simple normal terms, and off they go adding highly specific and technically correct words to what was supposed to be a simple explanation.
(I'm not a Haskell expert, I dabble, done CIS194, half of RWH, and I have no idea what you said -- which is a common problem I run into in the Haskell world, lots of super helpful people that have forgotten what its like to not speak their language)
Re:Frege: A Haskell-Like Language for the JVM
by skwosh on Thursday August 13, 2015 @09:51PM
(#10058232)
I think using Haskell's type syntax is misleading in this context (and doesn't really imply the required associativity (much less commutativity if you wanted to consider Abelian monoids)).
The operation of a monoid maps from pairs of things to things. So in terms of types:
<a,a> -> a
Or for some `twin` type constructor: twin a -> a
This is a bit more suggestive also in terms of F-algebras, where the operation has the following signature (f is a functor, or mappable container): f a -> a