I am not proud of my program structure.
My code is contained within a single module,
my main variables are contained in 8 mutable composite types
sometimes with as many as 30 type-annotated fields.
Some of my functions create the main variables as const globals
and these are conveniently used at various places in other functions.
Exported variables and functions are used from the REPL.
I know that this is considered bad programming practice
and type inference may fail at some places.
So I have tried hard to pass these variables as arguments
to all my functions but I have never succeded.
With several call levels the code becomes too ugly
and quick program development becomes a pain.
I really expect the arrival of type-annotated globals,
and hope that any performance penalty will be gone.
But please advise:
- Is this program structure really that terrible?
- How do you arrange your code in a better way?