Skip to content

Instantly share code, notes, and snippets.

@athas
Created May 27, 2020 14:24
Show Gist options
  • Select an option

  • Save athas/0ce077d4d05c665370561eb42986e66a to your computer and use it in GitHub Desktop.

Select an option

Save athas/0ce077d4d05c665370561eb42986e66a to your computer and use it in GitHub Desktop.
let hist2 [n] 'a (k: i32) (op: a -> a -> a) (ne: a) (is: [n](i32, i32)) (vs: [n](a,a)) : [k]a =
let x = reduce_by_index (replicate k ne) op ne (map (.0) is) (map (.0) vs)
let y = reduce_by_index (replicate k ne) op ne (map (.1) is) (map (.1) vs)
in map2 op x y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment