myriad
myriad copied to clipboard
Add how-to on creating a generator from scratch
I have an idea for a case study that would make a good how-to.
A generator that, given a DU type 'a
with individual cases of types 'b, 'c, 'd, ...
, can generate a function with the signature
a' seq -> 'b list * 'c list * 'd list * ...
The function takes a DU type sequence and splits it into separate lists for each case.
tuplising things or listifying things was a plugin that aI would like to do. Such as:
[Myriad.tuple]
myType = ...
let test = myType.create ...
let tupled = MyType.toTuple test
let result = MyType.fromTuple tupled