12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152(* TyXML
* http://www.ocsigen.org/tyxml
* Copyright (C) 2013 Gabriel Radanne <drupyog+caml@zoho.com>
*
* This program 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, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program 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 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1301, USA.
*)moduletypeT=sigtype'atvalreturn:'a->'attype(-'a,'b)ftvalfmap:('a,'b)ft->'at->'bttype'atlistvalnil:unit->'atlistvalsingleton:'at->'atlistvalcons:'at->'atlist->'atlistvalappend:'atlist->'atlist->'atlistvalmap:('a,'b)ft->'atlist->'btlistendmoduletypeNoWrap=Twithtype'at='aandtype'atlist='alistandtype(-'a,'b)ft='a->'bmoduleNoWrap=structtype'at='atype'atlist='alisttype(-'a,'b)ft='a->'bexternalreturn:'a->'a="%identity"letfmapf:'at->'bt=fletnil()=[]letsingletonx=[x]letconsxxs=x::xsletappendxy=x@yletmap=List.mapend