Skip to content

Instantly share code, notes, and snippets.

@ccapndave
Created August 15, 2018 16:07
Show Gist options
  • Save ccapndave/565ed1732fd923393224ddd0c0cd62f7 to your computer and use it in GitHub Desktop.
Save ccapndave/565ed1732fd923393224ddd0c0cd62f7 to your computer and use it in GitHub Desktop.
module Grid = {
module type Grid = {type t;};
type t = {
rowNames: list(string),
columnNames: list(string),
data: array(array(string)),
};
let make = (~rowNames, ~columnNames): t => {
rowNames,
columnNames,
data:
Array.make_matrix(
List.length(rowNames),
List.length(columnNames),
"",
),
};
};
let grid = Grid.Grid.make(~columnNames, ~rowNames);
Js.log(grid.data); /* surely this shouldn't be allowed??? */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment