Created
October 15, 2022 15:05
-
-
Save mheiber/9416ef06e2883f6bddfe1c5307fd9d29 to your computer and use it in GitHub Desktop.
This file contains 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
struct | |
type 'out t = < get : int -> 'out ; length : int > | |
let of_bytes v = | |
object | |
method length = bytes.length v | |
method get i = bytes.get v i | |
end | |
let of_array v = | |
object | |
method length = Array.length v | |
method get i = Array.get v i | |
end | |
let length t = t#length | |
let get t i = t#get i | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment