Should anyone need this in the future, I’ve written a modulo function by riding off the back of the recursive List type:
let Prelude =
https://prelude.dhall-lang.org/v20.1.0/package.dhall
sha256:26b0ef498663d269e4dc6a82b0ee289ec565d683ef4c00d0ebdd25333a5a3c98
let modulo =
λ(a : Natural) ->
λ(n : Natural) ->
let flattened = Prelude.List.generate a Natural (λ(_ : Natural) -> n)
let ff =
λ(_ : Natural) →
λ(acc : Natural) →
if Prelude.Natural.lessThan acc n
then acc
else Natural/subtract n acc
in List/fold
Natural
flattened
Natural
ff
a
I imagine this is not exactly the most optimal implementation but it works for my purposes for the time being.