summaryrefslogtreecommitdiffstats
path: root/lib/account/type.ml
diff options
context:
space:
mode:
authorRutger Broekhoff2026-03-09 22:29:18 +0100
committerRutger Broekhoff2026-03-09 22:29:18 +0100
commitc90ff5253efd858a2bf0c20eaa2ee9763a402783 (patch)
treed1c5ab837ece7034d882368f1beeeb56b934ac4d /lib/account/type.ml
parent2f94997e2befc70ada84bd04a56831efe2747220 (diff)
downloadrdcapsis-c90ff5253efd858a2bf0c20eaa2ee9763a402783.tar.gz
rdcapsis-c90ff5253efd858a2bf0c20eaa2ee9763a402783.zip
oha!
Diffstat (limited to 'lib/account/type.ml')
-rw-r--r--lib/account/type.ml15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/account/type.ml b/lib/account/type.ml
new file mode 100644
index 0000000..ad7a46e
--- /dev/null
+++ b/lib/account/type.ml
@@ -0,0 +1,15 @@
1type t = Type_hierarchy.path [@@deriving equal]
2
3let rec base (t : t) : t =
4 match Type_hierarchy.super t with
5 | None -> (* [t] is a base type *) t
6 | Some t' -> base t'
7
8(** [a] is a (strict) supertype of [b] *)
9let is_super t ~super ~strict =
10 Type_hierarchy.is_prefix super ~prefix:t
11 &&
12 (* strict → t ≠ super *)
13 ((not strict) || not ([%equal: t] t super))
14
15let polarity = Type_hierarchy.polarity