Earlier quoted context omitted.
You'd just do the same thing you do in any language, you parse the incoming data into a format that's more idiomatic, e.g. in Gleam type Record { NShares(n: Int) ZeroTheAccount() } fn parse_record(n: Int) -> Record { case n { 0 -> ZeroTheAccount() _ -> NShares(n) } } Then you don't have to worry about mixing up the two :)
no. you're mistaken. the error came about because the code calculated shares to give out as an average over certain set of values but in the particular business cycle there were no entries to average. a divide by zero error would have crashed and either triggered review or nothing would have happened. instead, dividing by zero was happily calculated as zero and everyone got a zero share disbursement, which meant "zer…
Re: Elixir 1.19
#151Ah, I see my mistake. Yeah that's definitely the kind of thing that could happen in Gleam.