4 ms·
I understand your motivation, but this is a really bad idea. If I didn't know Haskell and I saw "Joinable", I wouldn't know that that meant. "Concatenatable" se
by nilkn 10y ago
I understand your motivation, but this is a really bad idea. If I didn't know Haskell and I saw "Joinable", I wouldn't know that that meant. "Concatenatable" seems like it might be clearer, and it is a little bit but not completely, because the concept of "concatenation" doesn't apply to all monoids. For instance, here's a (not particularly useful) monoid that has nothing to do with concatenation:
newtype Sum a = Sum { getSum :: a }
instance (Num a) => Monoid (Sum a) where
mempty = Sum 0
mappend (Sum a) (Sum b) = Sum (a + b)
Finally, and perhaps most importantly, I seriously doubt anybody reading your codebase is going to do so in complete isolation of the rest of the Haskell ecosystem. They are going to encounter the word "monoid", so you're not really doing them any favors by hiding it from them. You're just forcing them to jump through the mental hurdles of reconciling your wording with what's used everywhere else.
- Iceland_jack 10y agoIt's funny you pick that example since of natural numbers can be viewed as lists (jargon: they are both free monoids) with addition as concatenation: type Natural = [()] zero, one, two, three, four :: Natural zero = [] one = [()] two = [(), ()] three = [(), (), ()] four = [(), (), (), ()] ... concatenation `(++) :: Natural -> Natural -> Natural`: >>> four [(), (), (), ()] >>> three ++ one [(), (), (), ()] Your point still holds. Our (non-jargon) vocabulary simply isn't equipped to deal with this level of abstraction so we need jargon if we intend to be fully descriptive — existing words don't cut it and we are just at the bottom rung of the abstraction ladder. It's up to us as a community how much we care about faithfully describing things, Simon Peyton Jones himself claims tongue-in-cheek that their biggest mistake was not calling monads “warm fuzzy things”[0] :) [0] http://research.microsoft.com/en-us/um/people/simonpj/papers/haskell-retrospective/HaskellRetrospective.pdf http://research.microsoft.com/en-us/um/people/simonpj/papers...