News for hackers. Stuff that matters.
Re:Roman Finger Counting by thanatropism on Thursday May 14, 2020 @11:35PM (#23188599)
Sum types versus product types.

You’re doing

     data Number = Left Segment | Right Segment
but

     data Number = BothHands Segment Segment
is possible.
Re:Roman Finger Counting by cannabis_sam on Friday May 15, 2020 @05:41AM (#23190423)
I just love how this illustrates the names sum and product types.

    permutations(sum of Segment) == permutations(Segment) + permutations(Segment) 
vs.

    permutations(product of Segment) == permutations(Segment) * permutations(Segment)
(Edit: permutations is the wrong term, it should be cardinality or a non-mathematical concept like some colloquial concept of “variations” )
Re:Roman Finger Counting by majewsky on Friday May 15, 2020 @06:20AM (#23190592)
I don't think "permutations" is the right word. You probably want "cardinality".
Re:Roman Finger Counting by cannabis_sam on Friday May 15, 2020 @06:43AM (#23190682)
You are right, I was thinking more from a programmers practical perspective and started with the word «varations» and changed it to «permutations» without thinking it through.

Thanks for the correction!