12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758(*
* Copyright (c) 2013-2017 Thomas Gazagnaire <thomas@gazagnaire.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)includeSlice_intfmoduleMake(Contents:Contents.STORE)(Node:Node.STORE)(Commit:Commit.STORE)=structtypecontents=Contents.Key.t*Contents.Val.t[@@derivingirmin]typenode=Node.Key.t*Node.Val.t[@@derivingirmin]typecommit=Commit.Key.t*Commit.Val.t[@@derivingirmin]typevalue=[`Contentsofcontents|`Nodeofnode|`Commitofcommit][@@derivingirmin]typet={mutablecontents:contentslist;mutablenodes:nodelist;mutablecommits:commitlist;}[@@derivingirmin]letempty()=Lwt.return{contents=[];nodes=[];commits=[]}letaddt=function|`Contentsc->t.contents<-c::t.contents;Lwt.return_unit|`Noden->t.nodes<-n::t.nodes;Lwt.return_unit|`Commitc->t.commits<-c::t.commits;Lwt.return_unitletitertf=Lwt.join[Lwt_list.iter_p(func->f(`Contentsc))t.contents;Lwt_list.iter_p(funn->f(`Noden))t.nodes;Lwt_list.iter_p(func->f(`Commitc))t.commits;]end