Thanks, glad you're enjoying it. I'm interested in your thoughts on tuples corresponding to logical "and". Can you describe what doesn't seem right about it?
When I think of a tuple, I think more of "a small record" than "two things that are true together". I can definitely squint to see it, but I almost wonder if a new And type would be clearer to match the Either type.
I see. It turns out that a custom And type would be a small record as well - exactly the same shape as Tuple but with different names (i.e. the two types are "isomorphic").
This is a very interesting article. I'm not sure I fully buy that tuple is always and, but I see where you're going with it.
Thanks, glad you're enjoying it. I'm interested in your thoughts on tuples corresponding to logical "and". Can you describe what doesn't seem right about it?
When I think of a tuple, I think more of "a small record" than "two things that are true together". I can definitely squint to see it, but I almost wonder if a new
Andtype would be clearer to match theEithertype.I see. It turns out that a custom
Andtype would be a small record as well - exactly the same shape asTuplebut with different names (i.e. the two types are "isomorphic").Here's
Tuple<T1, T2>from the .NET source code:And here's a custom
Andtype:Usage: