linol/lsp/bin/ocaml/ml_kind.ml
Simon Cruanes 7fbc187548 Squashed 'thirdparty/lsp/' content from commit aae69863
git-subtree-dir: thirdparty/lsp
git-subtree-split: aae6986391a8519de3da6a7a341f2bd3376e0d2f
2025-04-10 15:44:25 -04:00

28 lines
426 B
OCaml

open! Import
type 'a t =
{ intf : 'a
; impl : 'a
}
type kind =
| Impl
| Intf
let get { intf; impl } = function
| Impl -> impl
| Intf -> intf
;;
let make_both a = { intf = a; impl = a }
let iter { intf; impl } ~f =
f intf;
f impl
;;
let map { intf; impl } ~f = { intf = f intf; impl = f impl }
let both (type a b) (x : a t) (y : b t) : (a * b) t =
{ intf = x.intf, y.intf; impl = x.impl, y.impl }
;;