I will (once again) mention my old post: A type proposal
What bothers me the most is the inconsitency in constructor generation (type alias for Records, and custom types), hence no constuctor for Tuples.
My point is that custom types might become the only ones to generate constructor functions, and eventually treat values as either Records or Tuples, the propo:
-- regular aliases are unchanged (and could rapidly be unused)
type alias MaybeFloat = Maybe Float
-- record aliases do not generate constructors anymore
type alias NoConstructor =
{ name : String
, email : String
}
-- union types are the only ones with constructors
type MyType a
= Const
| Value a
| Record { foo : String }
| Tuple (a, a)
-- The true changes lay in there:
-- GENERATED CONSTRUCTORS:
Const : MyType a
Value : a -> MyType a
Record : String -> MyType a
Tuple : a -> a -> MyType a
Why not even limit Custom types to one value (and use Tuples to emulate current behaviour). Read my post for even more ideas, especially to also have function that accept the actual record or the actual tuple.
I think it’s very associated with what you’re saying, WDYT?