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").
And
Tuple
Here's Tuple<T1, T2> from the .NET source code:
Tuple<T1, T2>
public class Tuple<T1, T2> : ... { private readonly T1 m_Item1; private readonly T2 m_Item2; public T1 Item1 { get { return m_Item1; } } public T2 Item2 { get { return m_Item2; } } public Tuple(T1 item1, T2 item2) { m_Item1 = item1; m_Item2 = item2; } ...
And here's a custom And type:
public class And<A, B> : ... { private readonly A _proof_of_A; private readonly B _proof_of_B; public A ProofOfA { get { return _proof_of_A; } } public B ProofOfB { get { return _proof_of_B; } } public And(A proof_of_A, B proof_of_B) { _proof_of_A = proof_of_A; _proof_of_B = proof_of_B; } ...
Usage:
var modus_ponens_input_tuple = new Tuple(A_implies_B, proof_of_A); var modus_ponens_input_custom = new And(A_implies_B, proof_of_A);
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I see. It turns out that a custom
And
type would be a small record as well - exactly the same shape asTuple
but 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
And
type:Usage: