On Wednesday, October 19, 2016 at 7:39:25 PM UTC-6, Nathan Schultz wrote:
>
> Primes I'll miss for convenience, like when naming an inner tail-recursion
> function to distinguish it from its wrapper. But it's not a big deal.
>
The convention for that in a few other languages is the name 'aux', such as
in this copy/paste, perhaps that same convention could be brought in for
that purpose?
let rle list =
let rec aux count acc = function
| [] -> [] (* Can only be reached if original list is empty *)
| [x] -> (x, count + 1) :: acc
| a :: (b :: _ as t) ->
if a = b then aux (count + 1) acc t
else aux 0 ((a, count + 1) :: acc) t in aux 0 [] list
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.