diff options
| author | Emilio Jesus Gallego Arias | 2019-02-19 18:07:19 +0100 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2019-02-19 18:07:19 +0100 |
| commit | c3cc72ccf586703ed009a8bdd5df8d40b0384ab2 (patch) | |
| tree | 06a68b153c71a5cd8caf57572ffb59e52f507265 /lib | |
| parent | 6e3850ce5092d5cb432ef917ae6ee79225089f6a (diff) | |
| parent | a8a26c87d52c30e5e5d1ba76f1920e8bc68bcd45 (diff) | |
Merge PR #9297: Two fixes in printing notations with patterns
Reviewed-by: ejgallego
Ack-by: herbelin
Reviewed-by: mattam82
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dAst.ml | 2 | ||||
| -rw-r--r-- | lib/dAst.mli | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/dAst.ml b/lib/dAst.ml index f34ab956a3..803b2a0cff 100644 --- a/lib/dAst.ml +++ b/lib/dAst.ml @@ -30,6 +30,8 @@ let make ?loc v = CAst.make ?loc (Value v) let delay ?loc v = CAst.make ?loc (Thunk (Lazy.from_fun v)) +let force x = CAst.make ?loc:x.CAst.loc (Value (get_thunk x.v)) + let map f n = CAst.map (fun x -> map_thunk f x) n let map_with_loc f n = diff --git a/lib/dAst.mli b/lib/dAst.mli index 28c78784e6..2f58cfc41f 100644 --- a/lib/dAst.mli +++ b/lib/dAst.mli @@ -21,6 +21,7 @@ val get_thunk : ('a, 'b) thunk -> 'a val make : ?loc:Loc.t -> 'a -> ('a, 'b) t val delay : ?loc:Loc.t -> (unit -> 'a) -> ('a, [ `thunk ]) t +val force : ('a, 'b) t -> ('a, 'b) t val map : ('a -> 'b) -> ('a, 'c) t -> ('b, 'c) t val map_with_loc : (?loc:Loc.t -> 'a -> 'b) -> ('a, 'c) t -> ('b, 'c) t |
