Javascript to Elm

9: Union Types, save me from myself

Informações:

Sinopsis

  Union Types Known as tagged unions or ADTs Tagged Unions: a data structure used to hold a value that could take on several different, BUT fixed types. Only ONE of the types can be used at any single given time. The ‘tag’ field indicates explicitly which one is currently in use. Referred to as datatypes or algebraic data type (ADT). Leveraged in functional languages like what we’re doing now. Probably why I haven’t heard of them in nearly a decade yet. aside man, being a n00b is hard. I think it’s to quickly forgotten that feeling of being overwhelmed at every turn. Thinking, man I’ll never get this. I brush those feelings off everytime I work in Elm, Haskell, Rust, or any else that I am not intimately familiar with, the kind of familiarity that only comes after years of working with something. Having been down this road before, I know, that if i keep at it, it will come. It will snap into place for me, slowly, piece by piece. Now think about those who are possibly working on understanding their first lan