Hi there!
Let’s say I have a simple Record type like this:
type message = {
id: int,
tags: option(array(string)),
body: option(string),
};
Is it possible to iterate (map or loop) over each field of the message
type itself (not the instance).
I have a function that should take a record type (e.g. message
) as an argument and then create a HTML dropdown list depending on the record field names and their types. Practically this means I need to iterate over each filed and pattern match the types for each of them.
Does anyone how this could be done?