Created
August 15, 2018 16:07
-
-
Save ccapndave/565ed1732fd923393224ddd0c0cd62f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | |
"", | |
), | |
}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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