package highway

  1. Overview
  2. Docs

Source file pattern.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(* Copyright (c) 2026, Cargocut and the Highway developers.
   All rights reserved.

   SPDX-License-Identifier: BSD-3-Clause *)

type (_, _) t =
  | Literal : string -> ('a, 'a) t
  | Hole : 'a Hole.t -> ('a -> 'b, 'b) t

let s x = Literal x
let string = Hole Hole.string
let int = Hole Hole.int
let char = Hole Hole.char
let float = Hole Hole.float
let bool = Hole Hole.bool
let opt ?empty hole = Hole (Hole.opt ?empty hole ())