1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950(*******************************************************************************)(* Vcs - a Versatile OCaml Library for Git Operations *)(* Copyright (C) 2024 Mathieu Barbin <mathieu.barbin@gmail.com> *)(* *)(* This file is part of Vcs. *)(* *)(* Vcs is free software; you can redistribute it and/or modify it under *)(* the terms of the GNU Lesser General Public License as published by the *)(* Free Software Foundation either version 3 of the License, or any later *)(* version, with the LGPL-3.0 Linking Exception. *)(* *)(* Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *)(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *)(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *)(* the file `NOTICE.md` at the root of this repository for more details. *)(* *)(* You should have received a copy of the GNU Lesser General Public License *)(* and the LGPL-3.0 Linking Exception along with this library. If not, see *)(* <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively. *)(*******************************************************************************)moduletypeS=Validated_string_intf.SmoduletypeX=Validated_string_intf.XmoduleString=StringLabelsmoduleMake(X:X)=structletto_stringt=tletof_strings=ifX.invariantsthenOkselse(letshown_s=ifString.lengths>40thenString.subs~pos:0~len:40^"..."^Printf.sprintf" (%d characters total)"(String.lengths)elsesinError(`Msg(Printf.sprintf"%S: invalid %s"shown_sX.module_name)));;letvs=matchof_stringswith|Okt->t|Error(`Msgm)->raise(Invalid_argumentm);;end