, , , , IntOrChar " ", IntOrChar, , Int Char.
( C):
typedef union { char c; int i; } intorchar;
IntOrChar, (apriori), . union struct -:
typedef struct {
int tag;
union { char c; int i; } intorchar_u
} IntOrChar;
tag , .
union , , . , int ( 8- 32- int):
union { char b[4]; int i }
, " " " ", , .
IntOrChar ( ), , : , Int ( , Int), a Char ( , Char). , , .
F(a,b) a, b, :
F(IntOrChar,b) = F(Int,b) \times F(Char,b)
\times .
IntOrChar, , , , , Int Char, :
F(intorchar,b) = F(Int,b) \cap F(Char,b)
\cap .
Haskell ( ), , , . Haskell , [2, 'b']. , .
, , , , :
[ I 2, C 'b', ... ]
If you don’t mark your values, you create something similar to an anonymous union, but since there are no (useful) functions that can be applied to both integers and characters, you really can’t do anything with such an union.