You probably want to have closing ends for funs in your last example, or even use “the most sexiest part of the language,” according to José:
|> Enum.drop_while(& &1[speed] <= &1[speed_limit])
|> Enum.chunk_by(& &1[speed] > &1[speed_limit])
|> Enum.map(fun x ->
head = hd(x)
duration: DateTime.diff(List.last(x)[timestamp] - head[timestamp])}
|> Enum.filter(& &1[duration] >= 60)
Pentalinguistics is hard :)
P.S. Great explanation, thank you.
Ahh, you're right! That's what I get for hastily typing it up. Thanks for the catch!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.