mirror of
https://github.com/c-cube/linol.git
synced 2025-12-10 05:04:00 -05:00
git-subtree-dir: thirdparty/lsp git-subtree-split: aae6986391a8519de3da6a7a341f2bd3376e0d2f
28 lines
426 B
OCaml
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 }
|
|
;;
|