Though I'm familiar with functional programming, I mainly work in Python, so I'm new to Elm's type annotations, tagged unions, and purity. I thought I'd play around with Elm a bit by writing a program to generate a random name. I've done this for a number of different programming languages, and found it helpful.
There are three areas I'm interested in exploring more after my first attempt at Elm.
Though I've never used monads, I understand they are helpful in writing programs that depend on random numbers, like this one. My code seems a bit crufty in this first iteration, since I have to explicitly create a variable for every value that depends on a random seed, and I also have to create a variable for every seed.
I ran into a compiler error that seemed to result from my using one tag in multiple tagged unions. In my case, it was using Just a
in both Maybe
and Length
.
It doesn't seem like I can express a data type that would allow arbitrary function composition.