Something went wrong. Try again.
forked from coq/coq
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435(************************************************************************)(* * The Rocq Prover / The Rocq Development Team *)(* v * Copyright INRIA, CNRS and contributors *)(* <O___,, * (see version control and CREDITS file for authors & dates) *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)
type 'a t = { v : 'a; loc : Loc.t option;}
let make ?loc v = { v; loc }
let map f n = { n with v = f n.v }let map_with_loc f n = { n with v = f ?loc:n.loc n.v }let map_from_loc f l = let loc, v = l in { v = f ?loc v ; loc }
let with_val f n = f n.vlet with_loc_val f n = f ?loc:n.loc n.v
let eq f x y = f x.v y.v
module Smart = struct let map f n = let v' = f n.v in if v' == n.v then n else {n with v=v'}end