Skip to content

Instantly share code, notes, and snippets.

@ahoka
Created January 26, 2016 10:53
Show Gist options
  • Save ahoka/1e038c287b4ba0693165 to your computer and use it in GitHub Desktop.
Save ahoka/1e038c287b4ba0693165 to your computer and use it in GitHub Desktop.
val m = [[1, 2, 3], [6, 5, 4]];
fun rot90 (matrix) =
let
fun rot90 (m, acc) =
if null (hd m) then
rev acc
else
rot90 (map tl m, map hd m :: acc)
in
rot90 (matrix, nil)
end;
rot90 (m)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment