Skip to content

Instantly share code, notes, and snippets.

@philipschwarz
Created May 1, 2020 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipschwarz/ad752ae951a69dda68280d9cd9bdcbec to your computer and use it in GitHub Desktop.
Save philipschwarz/ad752ae951a69dda68280d9cd9bdcbec to your computer and use it in GitHub Desktop.
base.List.map : (a ->{𝕖} b) -> [a] ->{𝕖} [b]
base.List.map f a =
go i as acc =
match List.at i as with
None -> acc
Some a ->
use Nat +
go (i + 1) as (acc :+ f a)
go 0 a []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment