From 39368396f741bb156e38560ec3040926eb9d27df Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 6 Aug 2018 11:54:50 -0500 Subject: [PATCH] doc for 2.3 --- 2.3/containers/CCArray/.jbuilder-keep | 0 2.3/containers/CCArray/index.html | 67 +++++ .../CCArray/module-type-MONO_ARRAY/index.html | 2 + 2.3/containers/CCArrayLabels/.jbuilder-keep | 0 .../CCArrayLabels/Floatarray/index.html | 2 + 2.3/containers/CCArrayLabels/index.html | 67 +++++ .../module-type-MONO_ARRAY/index.html | 2 + 2.3/containers/CCArray_slice/.jbuilder-keep | 0 2.3/containers/CCArray_slice/index.html | 59 +++++ 2.3/containers/CCBV/.jbuilder-keep | 0 2.3/containers/CCBV/index.html | 18 ++ 2.3/containers/CCBijection/.jbuilder-keep | 0 .../CCBijection/Make/argument-1-L/index.html | 2 + .../CCBijection/Make/argument-2-R/index.html | 2 + 2.3/containers/CCBijection/Make/index.html | 7 + 2.3/containers/CCBijection/index.html | 4 + .../module-type-OrderedType/index.html | 2 + .../CCBijection/module-type-S/index.html | 7 + 2.3/containers/CCBitField/.jbuilder-keep | 0 .../CCBitField/Make/argument-1-X/index.html | 2 + 2.3/containers/CCBitField/Make/index.html | 4 + 2.3/containers/CCBitField/index.html | 15 ++ .../CCBitField/module-type-S/index.html | 4 + 2.3/containers/CCBlockingQueue/.jbuilder-keep | 0 2.3/containers/CCBlockingQueue/index.html | 9 + 2.3/containers/CCBool/.jbuilder-keep | 0 2.3/containers/CCBool/index.html | 2 + 2.3/containers/CCCache/.jbuilder-keep | 0 2.3/containers/CCCache/index.html | 38 +++ 2.3/containers/CCChar/.jbuilder-keep | 0 2.3/containers/CCChar/index.html | 9 + 2.3/containers/CCDeque/.jbuilder-keep | 0 2.3/containers/CCDeque/index.html | 13 + 2.3/containers/CCEqual/.jbuilder-keep | 0 2.3/containers/CCEqual/Infix/index.html | 2 + 2.3/containers/CCEqual/index.html | 7 + 2.3/containers/CCFQueue/.jbuilder-keep | 0 2.3/containers/CCFQueue/index.html | 8 + 2.3/containers/CCFloat/.jbuilder-keep | 0 2.3/containers/CCFloat/Infix/index.html | 2 + 2.3/containers/CCFloat/index.html | 8 + 2.3/containers/CCFormat/.jbuilder-keep | 0 2.3/containers/CCFormat/Dump/index.html | 2 + 2.3/containers/CCFormat/index.html | 44 ++++ 2.3/containers/CCFun/.jbuilder-keep | 0 .../CCFun/Monad/argument-1-X/index.html | 2 + 2.3/containers/CCFun/Monad/index.html | 2 + 2.3/containers/CCFun/index.html | 18 ++ 2.3/containers/CCFun_vec/.jbuilder-keep | 0 2.3/containers/CCFun_vec/index.html | 3 + 2.3/containers/CCGraph/.jbuilder-keep | 0 2.3/containers/CCGraph/Dot/index.html | 2 + 2.3/containers/CCGraph/Lazy_tree/index.html | 2 + 2.3/containers/CCGraph/Map/index.html | 4 + 2.3/containers/CCGraph/Seq/index.html | 2 + .../CCGraph/Traverse/Event/index.html | 2 + 2.3/containers/CCGraph/Traverse/index.html | 7 + 2.3/containers/CCGraph/index.html | 36 +++ .../CCGraph/module-type-MAP/index.html | 4 + 2.3/containers/CCHash/.jbuilder-keep | 0 2.3/containers/CCHash/index.html | 8 + 2.3/containers/CCHashSet/.jbuilder-keep | 0 .../CCHashSet/Make/argument-1-E/index.html | 2 + 2.3/containers/CCHashSet/Make/index.html | 3 + 2.3/containers/CCHashSet/index.html | 2 + .../CCHashSet/module-type-ELEMENT/index.html | 2 + .../CCHashSet/module-type-S/index.html | 3 + 2.3/containers/CCHashTrie/.jbuilder-keep | 0 .../CCHashTrie/Make/argument-1-K/index.html | 2 + 2.3/containers/CCHashTrie/Make/index.html | 9 + .../CCHashTrie/Transient/index.html | 7 + 2.3/containers/CCHashTrie/index.html | 6 + .../CCHashTrie/module-type-KEY/index.html | 2 + .../CCHashTrie/module-type-S/index.html | 9 + 2.3/containers/CCHashtbl/.jbuilder-keep | 0 2.3/containers/CCHashtbl/Poly/index.html | 22 ++ 2.3/containers/CCHashtbl/index.html | 22 ++ .../CCHashtbl/module-type-S/index.html | 22 ++ 2.3/containers/CCHeap/.jbuilder-keep | 0 .../CCHeap/Make/argument-1-E/index.html | 2 + 2.3/containers/CCHeap/Make/index.html | 14 ++ .../Make_from_compare/argument-1-E/index.html | 5 + .../CCHeap/Make_from_compare/index.html | 17 ++ 2.3/containers/CCHeap/index.html | 5 + .../CCHeap/module-type-PARTIAL_ORD/index.html | 2 + .../CCHeap/module-type-S/index.html | 14 ++ .../CCHeap/module-type-TOTAL_ORD/index.html | 5 + 2.3/containers/CCHet/.jbuilder-keep | 0 2.3/containers/CCHet/Key/index.html | 2 + 2.3/containers/CCHet/Map/index.html | 2 + 2.3/containers/CCHet/Tbl/index.html | 2 + 2.3/containers/CCHet/index.html | 3 + 2.3/containers/CCIO/.jbuilder-keep | 0 2.3/containers/CCIO/File/index.html | 14 ++ 2.3/containers/CCIO/index.html | 23 ++ 2.3/containers/CCImmutArray/.jbuilder-keep | 0 2.3/containers/CCImmutArray/index.html | 8 + 2.3/containers/CCInt/.jbuilder-keep | 0 2.3/containers/CCInt/Infix/index.html | 2 + 2.3/containers/CCInt/index.html | 10 + 2.3/containers/CCInt32/.jbuilder-keep | 0 2.3/containers/CCInt32/Infix/index.html | 2 + 2.3/containers/CCInt32/index.html | 39 +++ 2.3/containers/CCInt64/.jbuilder-keep | 0 2.3/containers/CCInt64/Infix/index.html | 2 + 2.3/containers/CCInt64/index.html | 46 ++++ 2.3/containers/CCIntMap/.jbuilder-keep | 0 2.3/containers/CCIntMap/index.html | 6 + 2.3/containers/CCKList/.jbuilder-keep | 0 2.3/containers/CCKList/Infix/index.html | 2 + .../CCKList/Traverse/argument-1-M/index.html | 2 + 2.3/containers/CCKList/Traverse/index.html | 2 + 2.3/containers/CCKList/index.html | 16 ++ .../CCKList/module-type-MONAD/index.html | 2 + 2.3/containers/CCKTree/.jbuilder-keep | 0 2.3/containers/CCKTree/Dot/index.html | 4 + .../CCKTree/class-type-pset/index.html | 2 + 2.3/containers/CCKTree/index.html | 22 ++ 2.3/containers/CCLazy_list/.jbuilder-keep | 0 2.3/containers/CCLazy_list/Infix/index.html | 2 + 2.3/containers/CCLazy_list/index.html | 3 + 2.3/containers/CCList/.jbuilder-keep | 0 2.3/containers/CCList/Assoc/index.html | 4 + 2.3/containers/CCList/Infix/index.html | 2 + 2.3/containers/CCList/Ref/index.html | 3 + .../CCList/Traverse/argument-1-M/index.html | 2 + 2.3/containers/CCList/Traverse/index.html | 4 + 2.3/containers/CCList/index.html | 117 +++++++++ .../CCList/module-type-MONAD/index.html | 2 + 2.3/containers/CCListLabels/.jbuilder-keep | 0 2.3/containers/CCListLabels/Assoc/index.html | 4 + 2.3/containers/CCListLabels/Infix/index.html | 2 + 2.3/containers/CCListLabels/Ref/index.html | 3 + .../Traverse/argument-1-M/index.html | 2 + .../CCListLabels/Traverse/index.html | 4 + 2.3/containers/CCListLabels/index.html | 82 ++++++ .../CCListLabels/module-type-MONAD/index.html | 2 + 2.3/containers/CCLock/.jbuilder-keep | 0 2.3/containers/CCLock/LockRef/index.html | 2 + 2.3/containers/CCLock/index.html | 10 + 2.3/containers/CCMap/.jbuilder-keep | 0 2.3/containers/CCMap/index.html | 2 + 2.3/containers/CCMap/module-type-S/index.html | 10 + 2.3/containers/CCMixmap/.jbuilder-keep | 0 .../CCMixmap/Make/argument-1-X/index.html | 2 + 2.3/containers/CCMixmap/Make/index.html | 4 + 2.3/containers/CCMixmap/index.html | 25 ++ .../CCMixmap/module-type-ORD/index.html | 2 + .../CCMixmap/module-type-S/index.html | 4 + 2.3/containers/CCMixset/.jbuilder-keep | 0 2.3/containers/CCMixset/index.html | 17 ++ 2.3/containers/CCMixtbl/.jbuilder-keep | 0 2.3/containers/CCMixtbl/index.html | 32 +++ 2.3/containers/CCMonomorphic/.jbuilder-keep | 0 2.3/containers/CCMonomorphic/index.html | 2 + 2.3/containers/CCMultiMap/.jbuilder-keep | 0 .../CCMultiMap/Make/argument-1-K/index.html | 2 + .../CCMultiMap/Make/argument-2-V/index.html | 2 + 2.3/containers/CCMultiMap/Make/index.html | 3 + .../MakeBidir/argument-1-L/index.html | 2 + .../MakeBidir/argument-2-R/index.html | 2 + .../CCMultiMap/MakeBidir/index.html | 2 + 2.3/containers/CCMultiMap/index.html | 4 + .../CCMultiMap/module-type-BIDIR/index.html | 2 + .../module-type-OrderedType/index.html | 2 + .../CCMultiMap/module-type-S/index.html | 3 + 2.3/containers/CCMultiSet/.jbuilder-keep | 0 2.3/containers/CCMultiSet/Make/index.html | 8 + 2.3/containers/CCMultiSet/index.html | 2 + .../CCMultiSet/module-type-S/index.html | 8 + 2.3/containers/CCNativeint/.jbuilder-keep | 0 2.3/containers/CCNativeint/Infix/index.html | 2 + 2.3/containers/CCNativeint/index.html | 40 +++ 2.3/containers/CCOpt/.jbuilder-keep | 0 2.3/containers/CCOpt/Infix/index.html | 2 + 2.3/containers/CCOpt/index.html | 12 + 2.3/containers/CCOrd/.jbuilder-keep | 0 2.3/containers/CCOrd/Infix/index.html | 4 + 2.3/containers/CCOrd/index.html | 15 ++ 2.3/containers/CCPair/.jbuilder-keep | 0 2.3/containers/CCPair/index.html | 4 + 2.3/containers/CCParse/.jbuilder-keep | 0 2.3/containers/CCParse/Infix/index.html | 13 + 2.3/containers/CCParse/U/index.html | 6 + 2.3/containers/CCParse/index.html | 51 ++++ .../CCPersistentArray/.jbuilder-keep | 0 2.3/containers/CCPersistentArray/index.html | 20 ++ .../CCPersistentHashtbl/.jbuilder-keep | 0 .../Make/argument-1-H/index.html | 2 + .../CCPersistentHashtbl/Make/index.html | 10 + 2.3/containers/CCPersistentHashtbl/index.html | 5 + .../module-type-HashedType/index.html | 2 + .../module-type-S/index.html | 10 + 2.3/containers/CCPool/.jbuilder-keep | 0 .../CCPool/Make/Fut/Infix/index.html | 2 + 2.3/containers/CCPool/Make/Fut/index.html | 22 ++ .../CCPool/Make/argument-1-P/index.html | 2 + 2.3/containers/CCPool/Make/index.html | 3 + 2.3/containers/CCPool/index.html | 2 + .../CCPool/module-type-PARAM/index.html | 2 + 2.3/containers/CCRAL/.jbuilder-keep | 0 2.3/containers/CCRAL/Infix/index.html | 2 + 2.3/containers/CCRAL/index.html | 6 + 2.3/containers/CCRandom/.jbuilder-keep | 0 2.3/containers/CCRandom/index.html | 23 ++ 2.3/containers/CCRef/.jbuilder-keep | 0 2.3/containers/CCRef/index.html | 2 + 2.3/containers/CCResult/.jbuilder-keep | 0 2.3/containers/CCResult/Infix/index.html | 5 + .../CCResult/Traverse/argument-1-M/index.html | 2 + 2.3/containers/CCResult/Traverse/index.html | 2 + 2.3/containers/CCResult/index.html | 28 +++ .../CCResult/module-type-MONAD/index.html | 2 + 2.3/containers/CCRingBuffer/.jbuilder-keep | 0 .../CCRingBuffer/Array/Byte/index.html | 5 + .../Array/Make/argument-1-Elt/index.html | 2 + .../CCRingBuffer/Array/Make/index.html | 5 + 2.3/containers/CCRingBuffer/Array/index.html | 2 + .../Array/module-type-S/index.html | 5 + 2.3/containers/CCRingBuffer/Byte/index.html | 15 ++ .../CCRingBuffer/Make/Array/index.html | 5 + .../CCRingBuffer/Make/argument-1-X/index.html | 2 + 2.3/containers/CCRingBuffer/Make/index.html | 15 ++ .../MakeFromArray/argument-1-A/index.html | 5 + .../CCRingBuffer/MakeFromArray/index.html | 15 ++ 2.3/containers/CCRingBuffer/index.html | 3 + .../module-type-S/Array/index.html | 5 + .../CCRingBuffer/module-type-S/index.html | 16 ++ 2.3/containers/CCSemaphore/.jbuilder-keep | 0 2.3/containers/CCSemaphore/index.html | 6 + 2.3/containers/CCSet/.jbuilder-keep | 0 2.3/containers/CCSet/index.html | 2 + 2.3/containers/CCSet/module-type-S/index.html | 3 + 2.3/containers/CCSexp/.jbuilder-keep | 0 2.3/containers/CCSexp/Decoder/index.html | 3 + 2.3/containers/CCSexp/index.html | 8 + 2.3/containers/CCSexp_lex/.jbuilder-keep | 0 2.3/containers/CCSexp_lex/index.html | 2 + 2.3/containers/CCSimple_queue/.jbuilder-keep | 0 .../CCSimple_queue/Infix/index.html | 2 + 2.3/containers/CCSimple_queue/index.html | 4 + 2.3/containers/CCString/.jbuilder-keep | 0 2.3/containers/CCString/Find/index.html | 2 + 2.3/containers/CCString/Split/index.html | 9 + 2.3/containers/CCString/Sub/index.html | 3 + 2.3/containers/CCString/index.html | 22 ++ .../CCString/module-type-S/index.html | 3 + 2.3/containers/CCThread/.jbuilder-keep | 0 2.3/containers/CCThread/Arr/index.html | 3 + 2.3/containers/CCThread/Barrier/index.html | 6 + 2.3/containers/CCThread/index.html | 2 + 2.3/containers/CCTimer/.jbuilder-keep | 0 2.3/containers/CCTimer/index.html | 6 + 2.3/containers/CCTrie/.jbuilder-keep | 0 .../CCTrie/Make/argument-1-W/index.html | 2 + 2.3/containers/CCTrie/Make/index.html | 11 + .../CCTrie/MakeArray/argument-1-X/index.html | 2 + 2.3/containers/CCTrie/MakeArray/index.html | 11 + .../CCTrie/MakeList/argument-1-X/index.html | 2 + 2.3/containers/CCTrie/MakeList/index.html | 11 + 2.3/containers/CCTrie/String/index.html | 11 + 2.3/containers/CCTrie/index.html | 2 + .../CCTrie/module-type-ORDERED/index.html | 2 + .../CCTrie/module-type-S/index.html | 11 + .../CCTrie/module-type-WORD/index.html | 2 + 2.3/containers/CCUnix/.jbuilder-keep | 0 2.3/containers/CCUnix/Infix/index.html | 2 + 2.3/containers/CCUnix/index.html | 18 ++ 2.3/containers/CCUtf8_string/.jbuilder-keep | 0 2.3/containers/CCUtf8_string/index.html | 8 + 2.3/containers/CCVector/.jbuilder-keep | 0 2.3/containers/CCVector/index.html | 23 ++ 2.3/containers/CCWBTree/.jbuilder-keep | 0 .../CCWBTree/Make/argument-1-X/index.html | 2 + 2.3/containers/CCWBTree/Make/index.html | 12 + .../CCWBTree/MakeFull/argument-1-X/index.html | 2 + 2.3/containers/CCWBTree/MakeFull/index.html | 12 + 2.3/containers/CCWBTree/index.html | 2 + .../CCWBTree/module-type-KEY/index.html | 2 + .../CCWBTree/module-type-ORD/index.html | 2 + .../CCWBTree/module-type-S/index.html | 12 + 2.3/containers/CCZipper/.jbuilder-keep | 0 2.3/containers/CCZipper/index.html | 11 + 2.3/containers/Containers/.jbuilder-keep | 0 .../Containers/Hashtbl/Make/index.html | 2 + .../MakeSeeded/argument-1-H/index.html | 2 + .../Containers/Hashtbl/MakeSeeded/index.html | 2 + 2.3/containers/Containers/Hashtbl/index.html | 22 ++ .../Hashtbl/module-type-HashedType/index.html | 2 + .../Hashtbl/module-type-S'/index.html | 22 ++ .../Hashtbl/module-type-S/index.html | 2 + .../module-type-SeededHashedType/index.html | 2 + .../Hashtbl/module-type-SeededS/index.html | 2 + 2.3/containers/Containers/index.html | 2 + 2.3/containers/Containers_top/.jbuilder-keep | 0 2.3/containers/Containers_top/index.html | 2 + 2.3/containers/index.html | 20 ++ 2.3/index.html | 17 ++ 2.3/odoc.css | 234 ++++++++++++++++++ index.md | 1 + last | 2 +- 301 files changed, 2283 insertions(+), 1 deletion(-) create mode 100644 2.3/containers/CCArray/.jbuilder-keep create mode 100644 2.3/containers/CCArray/index.html create mode 100644 2.3/containers/CCArray/module-type-MONO_ARRAY/index.html create mode 100644 2.3/containers/CCArrayLabels/.jbuilder-keep create mode 100644 2.3/containers/CCArrayLabels/Floatarray/index.html create mode 100644 2.3/containers/CCArrayLabels/index.html create mode 100644 2.3/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html create mode 100644 2.3/containers/CCArray_slice/.jbuilder-keep create mode 100644 2.3/containers/CCArray_slice/index.html create mode 100644 2.3/containers/CCBV/.jbuilder-keep create mode 100644 2.3/containers/CCBV/index.html create mode 100644 2.3/containers/CCBijection/.jbuilder-keep create mode 100644 2.3/containers/CCBijection/Make/argument-1-L/index.html create mode 100644 2.3/containers/CCBijection/Make/argument-2-R/index.html create mode 100644 2.3/containers/CCBijection/Make/index.html create mode 100644 2.3/containers/CCBijection/index.html create mode 100644 2.3/containers/CCBijection/module-type-OrderedType/index.html create mode 100644 2.3/containers/CCBijection/module-type-S/index.html create mode 100644 2.3/containers/CCBitField/.jbuilder-keep create mode 100644 2.3/containers/CCBitField/Make/argument-1-X/index.html create mode 100644 2.3/containers/CCBitField/Make/index.html create mode 100644 2.3/containers/CCBitField/index.html create mode 100644 2.3/containers/CCBitField/module-type-S/index.html create mode 100644 2.3/containers/CCBlockingQueue/.jbuilder-keep create mode 100644 2.3/containers/CCBlockingQueue/index.html create mode 100644 2.3/containers/CCBool/.jbuilder-keep create mode 100644 2.3/containers/CCBool/index.html create mode 100644 2.3/containers/CCCache/.jbuilder-keep create mode 100644 2.3/containers/CCCache/index.html create mode 100644 2.3/containers/CCChar/.jbuilder-keep create mode 100644 2.3/containers/CCChar/index.html create mode 100644 2.3/containers/CCDeque/.jbuilder-keep create mode 100644 2.3/containers/CCDeque/index.html create mode 100644 2.3/containers/CCEqual/.jbuilder-keep create mode 100644 2.3/containers/CCEqual/Infix/index.html create mode 100644 2.3/containers/CCEqual/index.html create mode 100644 2.3/containers/CCFQueue/.jbuilder-keep create mode 100644 2.3/containers/CCFQueue/index.html create mode 100644 2.3/containers/CCFloat/.jbuilder-keep create mode 100644 2.3/containers/CCFloat/Infix/index.html create mode 100644 2.3/containers/CCFloat/index.html create mode 100644 2.3/containers/CCFormat/.jbuilder-keep create mode 100644 2.3/containers/CCFormat/Dump/index.html create mode 100644 2.3/containers/CCFormat/index.html create mode 100644 2.3/containers/CCFun/.jbuilder-keep create mode 100644 2.3/containers/CCFun/Monad/argument-1-X/index.html create mode 100644 2.3/containers/CCFun/Monad/index.html create mode 100644 2.3/containers/CCFun/index.html create mode 100644 2.3/containers/CCFun_vec/.jbuilder-keep create mode 100644 2.3/containers/CCFun_vec/index.html create mode 100644 2.3/containers/CCGraph/.jbuilder-keep create mode 100644 2.3/containers/CCGraph/Dot/index.html create mode 100644 2.3/containers/CCGraph/Lazy_tree/index.html create mode 100644 2.3/containers/CCGraph/Map/index.html create mode 100644 2.3/containers/CCGraph/Seq/index.html create mode 100644 2.3/containers/CCGraph/Traverse/Event/index.html create mode 100644 2.3/containers/CCGraph/Traverse/index.html create mode 100644 2.3/containers/CCGraph/index.html create mode 100644 2.3/containers/CCGraph/module-type-MAP/index.html create mode 100644 2.3/containers/CCHash/.jbuilder-keep create mode 100644 2.3/containers/CCHash/index.html create mode 100644 2.3/containers/CCHashSet/.jbuilder-keep create mode 100644 2.3/containers/CCHashSet/Make/argument-1-E/index.html create mode 100644 2.3/containers/CCHashSet/Make/index.html create mode 100644 2.3/containers/CCHashSet/index.html create mode 100644 2.3/containers/CCHashSet/module-type-ELEMENT/index.html create mode 100644 2.3/containers/CCHashSet/module-type-S/index.html create mode 100644 2.3/containers/CCHashTrie/.jbuilder-keep create mode 100644 2.3/containers/CCHashTrie/Make/argument-1-K/index.html create mode 100644 2.3/containers/CCHashTrie/Make/index.html create mode 100644 2.3/containers/CCHashTrie/Transient/index.html create mode 100644 2.3/containers/CCHashTrie/index.html create mode 100644 2.3/containers/CCHashTrie/module-type-KEY/index.html create mode 100644 2.3/containers/CCHashTrie/module-type-S/index.html create mode 100644 2.3/containers/CCHashtbl/.jbuilder-keep create mode 100644 2.3/containers/CCHashtbl/Poly/index.html create mode 100644 2.3/containers/CCHashtbl/index.html create mode 100644 2.3/containers/CCHashtbl/module-type-S/index.html create mode 100644 2.3/containers/CCHeap/.jbuilder-keep create mode 100644 2.3/containers/CCHeap/Make/argument-1-E/index.html create mode 100644 2.3/containers/CCHeap/Make/index.html create mode 100644 2.3/containers/CCHeap/Make_from_compare/argument-1-E/index.html create mode 100644 2.3/containers/CCHeap/Make_from_compare/index.html create mode 100644 2.3/containers/CCHeap/index.html create mode 100644 2.3/containers/CCHeap/module-type-PARTIAL_ORD/index.html create mode 100644 2.3/containers/CCHeap/module-type-S/index.html create mode 100644 2.3/containers/CCHeap/module-type-TOTAL_ORD/index.html create mode 100644 2.3/containers/CCHet/.jbuilder-keep create mode 100644 2.3/containers/CCHet/Key/index.html create mode 100644 2.3/containers/CCHet/Map/index.html create mode 100644 2.3/containers/CCHet/Tbl/index.html create mode 100644 2.3/containers/CCHet/index.html create mode 100644 2.3/containers/CCIO/.jbuilder-keep create mode 100644 2.3/containers/CCIO/File/index.html create mode 100644 2.3/containers/CCIO/index.html create mode 100644 2.3/containers/CCImmutArray/.jbuilder-keep create mode 100644 2.3/containers/CCImmutArray/index.html create mode 100644 2.3/containers/CCInt/.jbuilder-keep create mode 100644 2.3/containers/CCInt/Infix/index.html create mode 100644 2.3/containers/CCInt/index.html create mode 100644 2.3/containers/CCInt32/.jbuilder-keep create mode 100644 2.3/containers/CCInt32/Infix/index.html create mode 100644 2.3/containers/CCInt32/index.html create mode 100644 2.3/containers/CCInt64/.jbuilder-keep create mode 100644 2.3/containers/CCInt64/Infix/index.html create mode 100644 2.3/containers/CCInt64/index.html create mode 100644 2.3/containers/CCIntMap/.jbuilder-keep create mode 100644 2.3/containers/CCIntMap/index.html create mode 100644 2.3/containers/CCKList/.jbuilder-keep create mode 100644 2.3/containers/CCKList/Infix/index.html create mode 100644 2.3/containers/CCKList/Traverse/argument-1-M/index.html create mode 100644 2.3/containers/CCKList/Traverse/index.html create mode 100644 2.3/containers/CCKList/index.html create mode 100644 2.3/containers/CCKList/module-type-MONAD/index.html create mode 100644 2.3/containers/CCKTree/.jbuilder-keep create mode 100644 2.3/containers/CCKTree/Dot/index.html create mode 100644 2.3/containers/CCKTree/class-type-pset/index.html create mode 100644 2.3/containers/CCKTree/index.html create mode 100644 2.3/containers/CCLazy_list/.jbuilder-keep create mode 100644 2.3/containers/CCLazy_list/Infix/index.html create mode 100644 2.3/containers/CCLazy_list/index.html create mode 100644 2.3/containers/CCList/.jbuilder-keep create mode 100644 2.3/containers/CCList/Assoc/index.html create mode 100644 2.3/containers/CCList/Infix/index.html create mode 100644 2.3/containers/CCList/Ref/index.html create mode 100644 2.3/containers/CCList/Traverse/argument-1-M/index.html create mode 100644 2.3/containers/CCList/Traverse/index.html create mode 100644 2.3/containers/CCList/index.html create mode 100644 2.3/containers/CCList/module-type-MONAD/index.html create mode 100644 2.3/containers/CCListLabels/.jbuilder-keep create mode 100644 2.3/containers/CCListLabels/Assoc/index.html create mode 100644 2.3/containers/CCListLabels/Infix/index.html create mode 100644 2.3/containers/CCListLabels/Ref/index.html create mode 100644 2.3/containers/CCListLabels/Traverse/argument-1-M/index.html create mode 100644 2.3/containers/CCListLabels/Traverse/index.html create mode 100644 2.3/containers/CCListLabels/index.html create mode 100644 2.3/containers/CCListLabels/module-type-MONAD/index.html create mode 100644 2.3/containers/CCLock/.jbuilder-keep create mode 100644 2.3/containers/CCLock/LockRef/index.html create mode 100644 2.3/containers/CCLock/index.html create mode 100644 2.3/containers/CCMap/.jbuilder-keep create mode 100644 2.3/containers/CCMap/index.html create mode 100644 2.3/containers/CCMap/module-type-S/index.html create mode 100644 2.3/containers/CCMixmap/.jbuilder-keep create mode 100644 2.3/containers/CCMixmap/Make/argument-1-X/index.html create mode 100644 2.3/containers/CCMixmap/Make/index.html create mode 100644 2.3/containers/CCMixmap/index.html create mode 100644 2.3/containers/CCMixmap/module-type-ORD/index.html create mode 100644 2.3/containers/CCMixmap/module-type-S/index.html create mode 100644 2.3/containers/CCMixset/.jbuilder-keep create mode 100644 2.3/containers/CCMixset/index.html create mode 100644 2.3/containers/CCMixtbl/.jbuilder-keep create mode 100644 2.3/containers/CCMixtbl/index.html create mode 100644 2.3/containers/CCMonomorphic/.jbuilder-keep create mode 100644 2.3/containers/CCMonomorphic/index.html create mode 100644 2.3/containers/CCMultiMap/.jbuilder-keep create mode 100644 2.3/containers/CCMultiMap/Make/argument-1-K/index.html create mode 100644 2.3/containers/CCMultiMap/Make/argument-2-V/index.html create mode 100644 2.3/containers/CCMultiMap/Make/index.html create mode 100644 2.3/containers/CCMultiMap/MakeBidir/argument-1-L/index.html create mode 100644 2.3/containers/CCMultiMap/MakeBidir/argument-2-R/index.html create mode 100644 2.3/containers/CCMultiMap/MakeBidir/index.html create mode 100644 2.3/containers/CCMultiMap/index.html create mode 100644 2.3/containers/CCMultiMap/module-type-BIDIR/index.html create mode 100644 2.3/containers/CCMultiMap/module-type-OrderedType/index.html create mode 100644 2.3/containers/CCMultiMap/module-type-S/index.html create mode 100644 2.3/containers/CCMultiSet/.jbuilder-keep create mode 100644 2.3/containers/CCMultiSet/Make/index.html create mode 100644 2.3/containers/CCMultiSet/index.html create mode 100644 2.3/containers/CCMultiSet/module-type-S/index.html create mode 100644 2.3/containers/CCNativeint/.jbuilder-keep create mode 100644 2.3/containers/CCNativeint/Infix/index.html create mode 100644 2.3/containers/CCNativeint/index.html create mode 100644 2.3/containers/CCOpt/.jbuilder-keep create mode 100644 2.3/containers/CCOpt/Infix/index.html create mode 100644 2.3/containers/CCOpt/index.html create mode 100644 2.3/containers/CCOrd/.jbuilder-keep create mode 100644 2.3/containers/CCOrd/Infix/index.html create mode 100644 2.3/containers/CCOrd/index.html create mode 100644 2.3/containers/CCPair/.jbuilder-keep create mode 100644 2.3/containers/CCPair/index.html create mode 100644 2.3/containers/CCParse/.jbuilder-keep create mode 100644 2.3/containers/CCParse/Infix/index.html create mode 100644 2.3/containers/CCParse/U/index.html create mode 100644 2.3/containers/CCParse/index.html create mode 100644 2.3/containers/CCPersistentArray/.jbuilder-keep create mode 100644 2.3/containers/CCPersistentArray/index.html create mode 100644 2.3/containers/CCPersistentHashtbl/.jbuilder-keep create mode 100644 2.3/containers/CCPersistentHashtbl/Make/argument-1-H/index.html create mode 100644 2.3/containers/CCPersistentHashtbl/Make/index.html create mode 100644 2.3/containers/CCPersistentHashtbl/index.html create mode 100644 2.3/containers/CCPersistentHashtbl/module-type-HashedType/index.html create mode 100644 2.3/containers/CCPersistentHashtbl/module-type-S/index.html create mode 100644 2.3/containers/CCPool/.jbuilder-keep create mode 100644 2.3/containers/CCPool/Make/Fut/Infix/index.html create mode 100644 2.3/containers/CCPool/Make/Fut/index.html create mode 100644 2.3/containers/CCPool/Make/argument-1-P/index.html create mode 100644 2.3/containers/CCPool/Make/index.html create mode 100644 2.3/containers/CCPool/index.html create mode 100644 2.3/containers/CCPool/module-type-PARAM/index.html create mode 100644 2.3/containers/CCRAL/.jbuilder-keep create mode 100644 2.3/containers/CCRAL/Infix/index.html create mode 100644 2.3/containers/CCRAL/index.html create mode 100644 2.3/containers/CCRandom/.jbuilder-keep create mode 100644 2.3/containers/CCRandom/index.html create mode 100644 2.3/containers/CCRef/.jbuilder-keep create mode 100644 2.3/containers/CCRef/index.html create mode 100644 2.3/containers/CCResult/.jbuilder-keep create mode 100644 2.3/containers/CCResult/Infix/index.html create mode 100644 2.3/containers/CCResult/Traverse/argument-1-M/index.html create mode 100644 2.3/containers/CCResult/Traverse/index.html create mode 100644 2.3/containers/CCResult/index.html create mode 100644 2.3/containers/CCResult/module-type-MONAD/index.html create mode 100644 2.3/containers/CCRingBuffer/.jbuilder-keep create mode 100644 2.3/containers/CCRingBuffer/Array/Byte/index.html create mode 100644 2.3/containers/CCRingBuffer/Array/Make/argument-1-Elt/index.html create mode 100644 2.3/containers/CCRingBuffer/Array/Make/index.html create mode 100644 2.3/containers/CCRingBuffer/Array/index.html create mode 100644 2.3/containers/CCRingBuffer/Array/module-type-S/index.html create mode 100644 2.3/containers/CCRingBuffer/Byte/index.html create mode 100644 2.3/containers/CCRingBuffer/Make/Array/index.html create mode 100644 2.3/containers/CCRingBuffer/Make/argument-1-X/index.html create mode 100644 2.3/containers/CCRingBuffer/Make/index.html create mode 100644 2.3/containers/CCRingBuffer/MakeFromArray/argument-1-A/index.html create mode 100644 2.3/containers/CCRingBuffer/MakeFromArray/index.html create mode 100644 2.3/containers/CCRingBuffer/index.html create mode 100644 2.3/containers/CCRingBuffer/module-type-S/Array/index.html create mode 100644 2.3/containers/CCRingBuffer/module-type-S/index.html create mode 100644 2.3/containers/CCSemaphore/.jbuilder-keep create mode 100644 2.3/containers/CCSemaphore/index.html create mode 100644 2.3/containers/CCSet/.jbuilder-keep create mode 100644 2.3/containers/CCSet/index.html create mode 100644 2.3/containers/CCSet/module-type-S/index.html create mode 100644 2.3/containers/CCSexp/.jbuilder-keep create mode 100644 2.3/containers/CCSexp/Decoder/index.html create mode 100644 2.3/containers/CCSexp/index.html create mode 100644 2.3/containers/CCSexp_lex/.jbuilder-keep create mode 100644 2.3/containers/CCSexp_lex/index.html create mode 100644 2.3/containers/CCSimple_queue/.jbuilder-keep create mode 100644 2.3/containers/CCSimple_queue/Infix/index.html create mode 100644 2.3/containers/CCSimple_queue/index.html create mode 100644 2.3/containers/CCString/.jbuilder-keep create mode 100644 2.3/containers/CCString/Find/index.html create mode 100644 2.3/containers/CCString/Split/index.html create mode 100644 2.3/containers/CCString/Sub/index.html create mode 100644 2.3/containers/CCString/index.html create mode 100644 2.3/containers/CCString/module-type-S/index.html create mode 100644 2.3/containers/CCThread/.jbuilder-keep create mode 100644 2.3/containers/CCThread/Arr/index.html create mode 100644 2.3/containers/CCThread/Barrier/index.html create mode 100644 2.3/containers/CCThread/index.html create mode 100644 2.3/containers/CCTimer/.jbuilder-keep create mode 100644 2.3/containers/CCTimer/index.html create mode 100644 2.3/containers/CCTrie/.jbuilder-keep create mode 100644 2.3/containers/CCTrie/Make/argument-1-W/index.html create mode 100644 2.3/containers/CCTrie/Make/index.html create mode 100644 2.3/containers/CCTrie/MakeArray/argument-1-X/index.html create mode 100644 2.3/containers/CCTrie/MakeArray/index.html create mode 100644 2.3/containers/CCTrie/MakeList/argument-1-X/index.html create mode 100644 2.3/containers/CCTrie/MakeList/index.html create mode 100644 2.3/containers/CCTrie/String/index.html create mode 100644 2.3/containers/CCTrie/index.html create mode 100644 2.3/containers/CCTrie/module-type-ORDERED/index.html create mode 100644 2.3/containers/CCTrie/module-type-S/index.html create mode 100644 2.3/containers/CCTrie/module-type-WORD/index.html create mode 100644 2.3/containers/CCUnix/.jbuilder-keep create mode 100644 2.3/containers/CCUnix/Infix/index.html create mode 100644 2.3/containers/CCUnix/index.html create mode 100644 2.3/containers/CCUtf8_string/.jbuilder-keep create mode 100644 2.3/containers/CCUtf8_string/index.html create mode 100644 2.3/containers/CCVector/.jbuilder-keep create mode 100644 2.3/containers/CCVector/index.html create mode 100644 2.3/containers/CCWBTree/.jbuilder-keep create mode 100644 2.3/containers/CCWBTree/Make/argument-1-X/index.html create mode 100644 2.3/containers/CCWBTree/Make/index.html create mode 100644 2.3/containers/CCWBTree/MakeFull/argument-1-X/index.html create mode 100644 2.3/containers/CCWBTree/MakeFull/index.html create mode 100644 2.3/containers/CCWBTree/index.html create mode 100644 2.3/containers/CCWBTree/module-type-KEY/index.html create mode 100644 2.3/containers/CCWBTree/module-type-ORD/index.html create mode 100644 2.3/containers/CCWBTree/module-type-S/index.html create mode 100644 2.3/containers/CCZipper/.jbuilder-keep create mode 100644 2.3/containers/CCZipper/index.html create mode 100644 2.3/containers/Containers/.jbuilder-keep create mode 100644 2.3/containers/Containers/Hashtbl/Make/index.html create mode 100644 2.3/containers/Containers/Hashtbl/MakeSeeded/argument-1-H/index.html create mode 100644 2.3/containers/Containers/Hashtbl/MakeSeeded/index.html create mode 100644 2.3/containers/Containers/Hashtbl/index.html create mode 100644 2.3/containers/Containers/Hashtbl/module-type-HashedType/index.html create mode 100644 2.3/containers/Containers/Hashtbl/module-type-S'/index.html create mode 100644 2.3/containers/Containers/Hashtbl/module-type-S/index.html create mode 100644 2.3/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html create mode 100644 2.3/containers/Containers/Hashtbl/module-type-SeededS/index.html create mode 100644 2.3/containers/Containers/index.html create mode 100644 2.3/containers/Containers_top/.jbuilder-keep create mode 100644 2.3/containers/Containers_top/index.html create mode 100644 2.3/containers/index.html create mode 100644 2.3/index.html create mode 100644 2.3/odoc.css diff --git a/2.3/containers/CCArray/.jbuilder-keep b/2.3/containers/CCArray/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCArray/index.html b/2.3/containers/CCArray/index.html new file mode 100644 index 00000000..db905738 --- /dev/null +++ b/2.3/containers/CCArray/index.html @@ -0,0 +1,67 @@ + +CCArray (containers.CCArray)

Module CCArray

Array utils

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a gen = unit ‑> 'a option
type 'a equal = 'a ‑> 'a ‑> bool
type 'a ord = 'a ‑> 'a ‑> int
type 'a random_gen = Random.State.t ‑> 'a
type 'a printer = Format.formatter ‑> 'a ‑> unit

Arrays

include module type of sig ... end
external length : 'a array ‑> int = "%array_length"
external get : 'a array ‑> int ‑> 'a = "%array_safe_get"
external set : 'a array ‑> int ‑> 'a ‑> unit = "%array_safe_set"
external make : int ‑> 'a ‑> 'a array = "caml_make_vect"
external create : int ‑> 'a ‑> 'a array = "caml_make_vect"
  • Deprecated Use Array.make instead.
external create_float : int ‑> float array = "caml_make_float_vect"
val make_float : int ‑> float array
  • Deprecated Use Array.create_float instead.
val init : int ‑> (int ‑> 'a) ‑> 'a array
val make_matrix : int ‑> int ‑> 'a ‑> 'a array array
val create_matrix : int ‑> int ‑> 'a ‑> 'a array array
  • Deprecated Use Array.make_matrix instead.
val append : 'a array ‑> 'a array ‑> 'a array
val concat : 'a array list ‑> 'a array
val sub : 'a array ‑> int ‑> int ‑> 'a array
val copy : 'a array ‑> 'a array
val fill : 'a array ‑> int ‑> int ‑> 'a ‑> unit
val blit : 'a array ‑> int ‑> 'a array ‑> int ‑> int ‑> unit
val to_list : 'a array ‑> 'a list
val of_list : 'a list ‑> 'a array
val iter : ('a ‑> unit) ‑> 'a array ‑> unit
val iteri : (int ‑> 'a ‑> unit) ‑> 'a array ‑> unit
val map : ('a ‑> 'b) ‑> 'a array ‑> 'b array
val mapi : (int ‑> 'a ‑> 'b) ‑> 'a array ‑> 'b array
val fold_left : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b array ‑> 'a
val fold_right : ('b ‑> 'a ‑> 'a) ‑> 'b array ‑> 'a ‑> 'a
val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a array ‑> 'b array ‑> unit
val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a array ‑> 'b array ‑> 'c array
val for_all : ('a ‑> bool) ‑> 'a array ‑> bool
val exists : ('a ‑> bool) ‑> 'a array ‑> bool
val mem : 'a ‑> 'a array ‑> bool
val memq : 'a ‑> 'a array ‑> bool
val sort : ('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
val stable_sort : ('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
val fast_sort : ('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
external unsafe_get : 'a array ‑> int ‑> 'a = "%array_unsafe_get"
external unsafe_set : 'a array ‑> int ‑> 'a ‑> unit = "%array_unsafe_set"
module Floatarray = Array.Floatarray
type 'a t = 'a array

The type for arrays

val empty : 'a t

empty is the empty array, physically equal to ||.

val equal : 'a equal ‑> 'a t equal

equal eq a1 a2 is true if the lengths of a1 and a2 are the same +and if their corresponding elements test equal, using eq.

val compare : 'a ord ‑> 'a t ord

compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.

val swap : 'a t ‑> int ‑> int ‑> unit

swap a i j swaps elements at indices i and j.

  • Since: 1.4
val get : 'a t ‑> int ‑> 'a

get a n returns the element number n of array a. +The first element has number 0. +The last element has number length a - 1. +You can also write a.(n) instead of get a n.

Raise Invalid_argument "index out of bounds" +if n is outside the range 0 to (length a - 1).

val get_safe : 'a t ‑> int ‑> 'a option

get_safe a i returns Some a.(i) if i is a valid index.

  • Since: 0.18
val set : 'a t ‑> int ‑> 'a ‑> unit

set a n x modifies array a in place, replacing +element number n with x. +You can also write a.(n) <- x instead of set a n x.

Raise Invalid_argument "index out of bounds" +if n is outside the range 0 to length a - 1.

val length : _ t ‑> int

length a returns the length (number of elements) of the given array a.

val fold : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a

fold f acc a computes f (... (f (f acc a.(0)) a.(1)) ...) a.(n-1), +where n is the length of the array a.

val foldi : ('a ‑> int ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a

foldi f acc a is just like fold, but it also passes in the index +of each element as the second argument to the folded function f.

val fold_while : ('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> 'a ‑> 'b t ‑> 'a

fold_while f acc a folds left on array a until a stop condition via ('a, `Stop) +is indicated by the accumulator.

  • Since: 0.8
val fold_map : ('acc ‑> 'a ‑> 'acc * 'b) ‑> 'acc ‑> 'a t ‑> 'acc * 'b t

fold_map f acc a is a fold_left-like function, but it also maps the +array to another array.

  • Since: 1.2
val scan_left : ('acc ‑> 'a ‑> 'acc) ‑> 'acc ‑> 'a t ‑> 'acc t

scan_left f acc a returns the array + [|acc; f acc x0; f (f acc a.(0)) a.(1); …|] .

  • Since: 1.2
val iter : ('a ‑> unit) ‑> 'a t ‑> unit

iter f a applies function f in turn to all elements of a. +It is equivalent to f a.(0); f a.(1); ...; f a.(length a - 1); ().

val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

iteri f a is like iter, but the function f is applied with the index of the +element as first argument, and the element itself as second argument.

val blit : 'a t ‑> int ‑> 'a t ‑> int ‑> int ‑> unit

blit a1 o1 a2 o2 len copies len elements +from array a1, starting at element number o1, to array a2, +starting at element number o2. It works correctly even if +a1 and a2 are the same array, and the source and +destination chunks overlap.

Raise Invalid_argument "CCArray.blit" if o1 and len do not +designate a valid subarray of a1, or if o2 and len do not +designate a valid subarray of a2.

val reverse_in_place : 'a t ‑> unit

reverse_in_place a reverses the array a in place.

val sorted : ('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a array

sorted cmp a makes a copy of a and sorts it with cmp.

  • Since: 1.0
val sort_indices : ('a ‑> 'a ‑> int) ‑> 'a t ‑> int array

sort_indices cmp a returns a new array b, with the same length as a, +such that b.(i) is the index at which the i-th element of sorted cmp a +appears in a. a is not modified.

In other words, map (fun i -> a.(i)) (sort_indices cmp a) = sorted cmp a. +sort_indices yields the inverse permutation of sort_ranking.

  • Since: 1.0
val sort_ranking : ('a ‑> 'a ‑> int) ‑> 'a t ‑> int array

sort_ranking cmp a returns a new array b, with the same length as a, +such that b.(i) is the index at which the i-th element of a appears +in sorted cmp a. a is not modified.

In other words, map (fun i -> (sorted cmp a).(i)) (sort_ranking cmp a) = a. +sort_ranking yields the inverse permutation of sort_indices.

In the absence of duplicate elements in a, we also have +lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).

  • Since: 1.0
val find_map : ('a ‑> 'b option) ‑> 'a t ‑> 'b option

find_map f a returns Some y if there is an element x such +that f x = Some y. Otherwise returns None.

  • Since: 1.3
val find : ('a ‑> 'b option) ‑> 'a t ‑> 'b option

find f a is an alias to find_map.

  • Deprecated since 1.3, use find_map instead.
val find_map_i : (int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b option

find_map_i f a is like find_map, but the index of the element is also passed +to the predicate function f.

  • Since: 1.3
val findi : (int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b option

findi f a is an alias to find_map_i.

  • Since: 0.3.4
  • Deprecated since 1.3, use find_map_i instead.
val find_idx : ('a ‑> bool) ‑> 'a t ‑> (int * 'a) option

find_idx p a returns Some (i,x) where x is the i-th element of a, +and p x holds. Otherwise returns None.

  • Since: 0.3.4
val lookup : cmp:'a ord ‑> 'a ‑> 'a t ‑> int option

lookup cmp x a lookups the index of some key x in a sorted array a. +Undefined behavior if the array a is not sorted wrt cmp. +Complexity: O(log (n)) (dichotomic search).

  • Returns None if the key x is not present, or +Some i (i the index of the key) otherwise.
val lookup_exn : cmp:'a ord ‑> 'a ‑> 'a t ‑> int

lookup_exn cmp x a is like lookup, but

  • Raises Not_found: if the key x is not present.
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> 'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]

bsearch ~cmp x a finds the index of the object x in the array a, +provided a is sorted using cmp. If the array is not sorted, +the result is not specified (may raise Invalid_argument).

Complexity: O(log n) where n is the length of the array a +(dichotomic search).

  • Returns

    • `At i if cmp a.(i) x = 0 (for some i).
    • `All_lower if all elements of a are lower than x.
    • `All_bigger if all elements of a are bigger than x.
    • `Just_after i if a.(i) < x < a.(i+1).
    • `Empty if the array a is empty.
  • Raises Invalid_argument: if the array is found to be unsorted w.r.t cmp.
  • Since: 0.13
val for_all : ('a ‑> bool) ‑> 'a t ‑> bool

for_all p [|a1; ...; an|] is true if all elements of the array +satisfy the predicate p. That is, it returns +(p a1) && (p a2) && ... && (p an).

val for_all2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

for_all2 p [|a1; ...; an|] [|b1; ...; bn|] is true if each pair of elements ai bi +satisfies the predicate p. +That is, it returns (p a1 b1) && (p a2 b2) && ... && (p an bn).

  • Raises Invalid_argument: if arrays have distinct lengths. +Allow different types.
  • Since: 0.20
val exists : ('a ‑> bool) ‑> 'a t ‑> bool

exists p [|a1; ...; an|] is true if at least one element of +the array satisfies the predicate p. That is, it returns +(p a1) || (p a2) || ... || (p an).

val exists2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

exists2 p [|a1; ...; an|] [|b1; ...; bn|] is true if any pair of elements ai bi +satisfies the predicate p. +That is, it returns (p a1 b1) || (p a2 b2) || ... || (p an bn).

  • Raises Invalid_argument: if arrays have distinct lengths. +Allow different types.
  • Since: 0.20
val fold2 : ('acc ‑> 'a ‑> 'b ‑> 'acc) ‑> 'acc ‑> 'a t ‑> 'b t ‑> 'acc

fold2 f acc a b fold on two arrays a and b stepwise. +It computes f (... (f acc a1 b1)...) an bn.

  • Raises Invalid_argument: if arrays have distinct lengths.
  • Since: 0.20
val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit

iter2 f a b iterates on the two arrays a and b stepwise. +It is equivalent to f a0 b0; ...; f a.(length a - 1) b.(length b - 1); ().

  • Raises Invalid_argument: if arrays have distinct lengths.
  • Since: 0.20
val shuffle : 'a t ‑> unit

shuffle a randomly shuffles the array a, in place.

val shuffle_with : Random.State.t ‑> 'a t ‑> unit

shuffle_with rs a randomly shuffles the array a (like shuffle) but a specialized random +state rs is used to control the random numbers being produced during shuffling (for reproducibility).

val random_choose : 'a t ‑> 'a random_gen

random_choose a rs randomly chooses an element of a.

  • Raises Not_found: if the array/slice is empty.
val to_seq : 'a t ‑> 'a sequence

to_seq a returns a sequence of the elements of an array a. +The input array a is shared with the sequence and modification of it will result +in modification of the sequence.

val to_gen : 'a t ‑> 'a gen

to_gen a returns a gen of the elements of an array a.

val to_klist : 'a t ‑> 'a klist

to_klist returns a klist of the elements of an array a.

IO

val pp : ?⁠sep:string ‑> 'a printer ‑> 'a t printer

pp ~sep pp_item ppf a formats the array a on ppf. +Each element is formatted with pp_item and elements are separated +by sep (defaults to ", ").

val pp_i : ?⁠sep:string ‑> (int ‑> 'a printer) ‑> 'a t printer

pp_i ~sep pp_item ppf a prints the array a on ppf. +The printing function pp_item is giving both index and element. +Elements are separated by sep (defaults to ", ").

val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

map f a applies function f to all elements of a, +and builds an array with the results returned by f: +[| f a.(0); f a.(1); ...; f a.(length a - 1) |].

val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t

map2 f a b applies function f to all elements of a and b, +and builds an array with the results returned by f: +[| f a.(0) b.(0); ...; f a.(length a - 1) b.(length b - 1)|].

  • Raises Invalid_argument: if a and b have distinct lengths.
  • Since: 0.20
val rev : 'a t ‑> 'a t

rev a copies the array a and reverses it in place.

  • Since: 0.20
val filter : ('a ‑> bool) ‑> 'a t ‑> 'a t

filter p a filters elements out of the array a. Only the elements satisfying +the given predicate p will be kept.

val filter_map : ('a ‑> 'b option) ‑> 'a t ‑> 'b t

filter_map f [|a1; ...; an|] calls (f a1) ... (f an) and returns an array b consisting +of all elements bi such as f ai = Some bi. When f returns None, the corresponding +element of a is discarded.

val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b array

flat_map f a transforms each element of a into an array, then flattens.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

a >>= f is the infix version of flat_map.

val (>>|) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

a >>| f is the infix version of map.

  • Since: 0.8
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

a >|= f is the infix version of map.

  • Since: 0.8
val except_idx : 'a t ‑> int ‑> 'a list

except_idx a i removes the element of a at given index i, and returns +the list of the other elements.

val (--) : int ‑> int ‑> int t

x -- y creates an array containing integers in the range x .. y. Bounds included.

val (--^) : int ‑> int ‑> int t

x --^ y creates an array containing integers in the range x .. y. Right bound excluded.

  • Since: 0.17
val random : 'a random_gen ‑> 'a t random_gen
val random_non_empty : 'a random_gen ‑> 'a t random_gen
val random_len : int ‑> 'a random_gen ‑> 'a t random_gen

Generic Functions

module type MONO_ARRAY : sig ... end
val sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) ‑> cmp:('elt ‑> 'elt ‑> int) ‑> 'arr ‑> unit

sort_generic (module M) cmp a sorts the array a, without allocating (eats stack space though). +Performance might be lower than Array.sort.

  • Since: 0.14
\ No newline at end of file diff --git a/2.3/containers/CCArray/module-type-MONO_ARRAY/index.html b/2.3/containers/CCArray/module-type-MONO_ARRAY/index.html new file mode 100644 index 00000000..81b820cf --- /dev/null +++ b/2.3/containers/CCArray/module-type-MONO_ARRAY/index.html @@ -0,0 +1,2 @@ + +MONO_ARRAY (containers.CCArray.MONO_ARRAY)

Module type CCArray.MONO_ARRAY

type elt
type t
val length : t ‑> int
val get : t ‑> int ‑> elt
val set : t ‑> int ‑> elt ‑> unit
\ No newline at end of file diff --git a/2.3/containers/CCArrayLabels/.jbuilder-keep b/2.3/containers/CCArrayLabels/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCArrayLabels/Floatarray/index.html b/2.3/containers/CCArrayLabels/Floatarray/index.html new file mode 100644 index 00000000..5f3d59f9 --- /dev/null +++ b/2.3/containers/CCArrayLabels/Floatarray/index.html @@ -0,0 +1,2 @@ + +Floatarray (containers.CCArrayLabels.Floatarray)

Module CCArrayLabels.Floatarray

external create : int ‑> floatarray = "caml_floatarray_create"
external length : floatarray ‑> int = "%floatarray_length"
external get : floatarray ‑> int ‑> float = "%floatarray_safe_get"
external set : floatarray ‑> int ‑> float ‑> unit = "%floatarray_safe_set"
external unsafe_get : floatarray ‑> int ‑> float = "%floatarray_unsafe_get"
external unsafe_set : floatarray ‑> int ‑> float ‑> unit = "%floatarray_unsafe_set"
\ No newline at end of file diff --git a/2.3/containers/CCArrayLabels/index.html b/2.3/containers/CCArrayLabels/index.html new file mode 100644 index 00000000..beef01df --- /dev/null +++ b/2.3/containers/CCArrayLabels/index.html @@ -0,0 +1,67 @@ + +CCArrayLabels (containers.CCArrayLabels)

Module CCArrayLabels

Array utils

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a gen = unit ‑> 'a option
type 'a equal = 'a ‑> 'a ‑> bool
type 'a ord = 'a ‑> 'a ‑> int
type 'a random_gen = Random.State.t ‑> 'a
type 'a printer = Format.formatter ‑> 'a ‑> unit

Arrays

include module type of ArrayLabels
external length : 'a array ‑> int = "%array_length"
external get : 'a array ‑> int ‑> 'a = "%array_safe_get"
external set : 'a array ‑> int ‑> 'a ‑> unit = "%array_safe_set"
external make : int ‑> 'a ‑> 'a array = "caml_make_vect"
external create : int ‑> 'a ‑> 'a array = "caml_make_vect"
  • Deprecated Use Array.make instead.
val init : int ‑> f:(int ‑> 'a) ‑> 'a array
val make_matrix : dimx:int ‑> dimy:int ‑> 'a ‑> 'a array array
val create_matrix : dimx:int ‑> dimy:int ‑> 'a ‑> 'a array array
  • Deprecated Use Array.make_matrix instead.
val append : 'a array ‑> 'a array ‑> 'a array
val concat : 'a array list ‑> 'a array
val sub : 'a array ‑> pos:int ‑> len:int ‑> 'a array
val copy : 'a array ‑> 'a array
val fill : 'a array ‑> pos:int ‑> len:int ‑> 'a ‑> unit
val blit : src:'a array ‑> src_pos:int ‑> dst:'a array ‑> dst_pos:int ‑> len:int ‑> unit
val to_list : 'a array ‑> 'a list
val of_list : 'a list ‑> 'a array
val iter : f:('a ‑> unit) ‑> 'a array ‑> unit
val map : f:('a ‑> 'b) ‑> 'a array ‑> 'b array
val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a array ‑> unit
val mapi : f:(int ‑> 'a ‑> 'b) ‑> 'a array ‑> 'b array
val fold_left : f:('a ‑> 'b ‑> 'a) ‑> init:'a ‑> 'b array ‑> 'a
val fold_right : f:('b ‑> 'a ‑> 'a) ‑> 'b array ‑> init:'a ‑> 'a
val iter2 : f:('a ‑> 'b ‑> unit) ‑> 'a array ‑> 'b array ‑> unit
val map2 : f:('a ‑> 'b ‑> 'c) ‑> 'a array ‑> 'b array ‑> 'c array
val exists : f:('a ‑> bool) ‑> 'a array ‑> bool
val for_all : f:('a ‑> bool) ‑> 'a array ‑> bool
val mem : 'a ‑> set:'a array ‑> bool
val memq : 'a ‑> set:'a array ‑> bool
external create_float : int ‑> float array = "caml_make_float_vect"
val make_float : int ‑> float array
  • Deprecated Use Array.create_float instead.
val sort : cmp:('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
val stable_sort : cmp:('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
val fast_sort : cmp:('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
external unsafe_get : 'a array ‑> int ‑> 'a = "%array_unsafe_get"
external unsafe_set : 'a array ‑> int ‑> 'a ‑> unit = "%array_unsafe_set"
module Floatarray : sig ... end
type 'a t = 'a array

The type for arrays

val empty : 'a t

empty is the empty array, physically equal to ||.

val equal : 'a equal ‑> 'a t equal

equal eq a1 a2 is true if the lengths of a1 and a2 are the same +and if their corresponding elements test equal, using eq.

val compare : 'a ord ‑> 'a t ord

compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.

val swap : 'a t ‑> int ‑> int ‑> unit

swap a i j swaps elements at indices i and j.

  • Since: 1.4
val get : 'a t ‑> int ‑> 'a

get a n returns the element number n of array a. +The first element has number 0. +The last element has number length a - 1. +You can also write a.(n) instead of get a n.

Raise Invalid_argument "index out of bounds" +if n is outside the range 0 to (length a - 1).

val get_safe : 'a t ‑> int ‑> 'a option

get_safe a i returns Some a.(i) if i is a valid index.

  • Since: 0.18
val set : 'a t ‑> int ‑> 'a ‑> unit

set a n x modifies array a in place, replacing +element number n with x. +You can also write a.(n) <- x instead of set a n x.

Raise Invalid_argument "index out of bounds" +if n is outside the range 0 to length a - 1.

val length : _ t ‑> int

length a returns the length (number of elements) of the given array a.

val fold : f:('a ‑> 'b ‑> 'a) ‑> init:'a ‑> 'b t ‑> 'a

fold ~f ~init a computes ~f (... (~f (~f ~init a.(0)) a.(1)) ...) a.(n-1), +where n is the length of the array a.

val foldi : f:('a ‑> int ‑> 'b ‑> 'a) ‑> init:'a ‑> 'b t ‑> 'a

foldi ~f ~init a is just like fold, but it also passes in the index +of each element as the second argument to the folded function ~f.

val fold_while : f:('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> init:'a ‑> 'b t ‑> 'a

fold_while ~f ~init a folds left on array a until a stop condition via ('a, `Stop) +is indicated by the accumulator.

  • Since: 0.8
val fold_map : f:('acc ‑> 'a ‑> 'acc * 'b) ‑> init:'acc ‑> 'a t ‑> 'acc * 'b t

fold_map ~f ~init a is a fold_left-like function, but it also maps the +array to another array.

  • Since: 2.1
val scan_left : f:('acc ‑> 'a ‑> 'acc) ‑> init:'acc ‑> 'a t ‑> 'acc t

scan_left ~f ~init a returns the array + [|~init; ~f ~init x0; ~f (~f ~init a.(0)) a.(1); …|] .

  • Since: 2.1
val iter : f:('a ‑> unit) ‑> 'a t ‑> unit

iter ~f a applies function ~f in turn to all elements of a. +It is equivalent to ~f a.(0); ~f a.(1); ...; ~f a.(length a - 1); ().

val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

iteri ~f a is like iter, but the function ~f is applied with the index of the +element as first argument, and the element itself as second argument.

val blit : 'a t ‑> int ‑> 'a t ‑> int ‑> int ‑> unit

blit a1 o1 a2 o2 len copies len elements +from array a1, starting at element number o1, to array a2, +starting at element number o2. It works correctly even if +a1 and a2 are the same array, and the source and +destination chunks overlap.

Raise Invalid_argument "CCArray.blit" if o1 and len do not +designate a valid subarray of a1, or if o2 and len do not +designate a valid subarray of a2.

val reverse_in_place : 'a t ‑> unit

reverse_in_place a reverses the array a in place.

val sorted : f:('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a array

sorted ~f a makes a copy of a and sorts it with ~f.

  • Since: 1.0
val sort_indices : f:('a ‑> 'a ‑> int) ‑> 'a t ‑> int array

sort_indices ~f a returns a new array b, with the same length as a, +such that b.(i) is the index at which the i-th element of sorted ~f a +appears in a. a is not modified.

In other words, map (fun i -> a.(i)) (sort_indices ~f a) = sorted ~f a. +sort_indices yields the inverse permutation of sort_ranking.

  • Since: 1.0
val sort_ranking : f:('a ‑> 'a ‑> int) ‑> 'a t ‑> int array

sort_ranking ~f a returns a new array b, with the same length as a, +such that b.(i) is the index at which the i-th element of a appears +in sorted ~f a. a is not modified.

In other words, map (fun i -> (sorted ~f a).(i)) (sort_ranking ~f a) = a. +sort_ranking yields the inverse permutation of sort_indices.

In the absence of duplicate elements in a, we also have +lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).

  • Since: 1.0
val find_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b option

find_map ~f a returns Some y if there is an element x such +that ~f x = Some y. Otherwise returns None.

  • Since: 2.1
val find : f:('a ‑> 'b option) ‑> 'a t ‑> 'b option

find ~f a is an alias to find_map.

  • Deprecated since 2.1, use find_map instead.
val find_map_i : f:(int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b option

find_map_i ~f a is like find_map, but the index of the element is also passed +to the predicate function ~f.

  • Since: 2.1
val findi : f:(int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b option

findi ~f a is an alias to find_map_i.

  • Since: 0.3.4
  • Deprecated since 2.1, use find_map_i instead.
val find_idx : f:('a ‑> bool) ‑> 'a t ‑> (int * 'a) option

find_idx ~f a returns Some (i,x) where x is the i-th element of a, +and ~f x holds. Otherwise returns None.

  • Since: 0.3.4
val lookup : cmp:'a ord ‑> key:'a ‑> 'a t ‑> int option

lookup ~cmp ~key a lookups the index of some key ~key in a sorted array a. +Undefined behavior if the array a is not sorted wrt ~cmp. +Complexity: O(log (n)) (dichotomic search).

  • Returns None if the key ~key is not present, or +Some i (i the index of the key) otherwise.
val lookup_exn : cmp:'a ord ‑> key:'a ‑> 'a t ‑> int

lookup_exn ~cmp ~key a is like lookup, but

  • Raises Not_found: if the key ~key is not present.
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> key:'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]

bsearch ~cmp ~key a finds the index of the object ~key in the array a, +provided a is sorted using ~cmp. If the array is not sorted, +the result is not specified (may raise Invalid_argument).

Complexity: O(log n) where n is the length of the array a +(dichotomic search).

  • Returns

    • `At i if cmp a.(i) key = 0 (for some i).
    • `All_lower if all elements of a are lower than key.
    • `All_bigger if all elements of a are bigger than key.
    • `Just_after i if a.(i) < key < a.(i+1).
    • `Empty if the array a is empty.
  • Raises Invalid_argument: if the array is found to be unsorted w.r.t cmp.
  • Since: 0.13
val for_all : f:('a ‑> bool) ‑> 'a t ‑> bool

for_all ~f [|a1; ...; an|] is true if all elements of the array +satisfy the predicate ~f. That is, it returns +(~f a1) && (~f a2) && ... && (~f an).

val for_all2 : f:('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

for_all2 ~f [|a1; ...; an|] [|b1; ...; bn|] is true if each pair of elements ai bi +satisfies the predicate ~f. +That is, it returns (~f a1 b1) && (~f a2 b2) && ... && (~f an bn).

  • Raises Invalid_argument: if arrays have distinct lengths. +Allow different types.
  • Since: 0.20
val exists : f:('a ‑> bool) ‑> 'a t ‑> bool

exists ~f [|a1; ...; an|] is true if at least one element of +the array satisfies the predicate ~f. That is, it returns +(~f a1) || (~f a2) || ... || (~f an).

val exists2 : f:('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

exists2 ~f [|a1; ...; an|] [|b1; ...; bn|] is true if any pair of elements ai bi +satisfies the predicate ~f. +That is, it returns (~f a1 b1) || (~f a2 b2) || ... || (~f an bn).

  • Raises Invalid_argument: if arrays have distinct lengths. +Allow different types.
  • Since: 0.20
val fold2 : f:('acc ‑> 'a ‑> 'b ‑> 'acc) ‑> init:'acc ‑> 'a t ‑> 'b t ‑> 'acc

fold2 ~f ~init a b fold on two arrays a and b stepwise. +It computes ~f (... (~f ~init a1 b1)...) an bn.

  • Raises Invalid_argument: if a and b have distinct lengths.
  • Since: 0.20
val iter2 : f:('a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit

iter2 ~f a b iterates on the two arrays a and b stepwise. +It is equivalent to ~f a0 b0; ...; ~f a.(length a - 1) b.(length b - 1); ().

  • Raises Invalid_argument: if a and b have distinct lengths.
  • Since: 0.20
val shuffle : 'a t ‑> unit

shuffle a randomly shuffles the array a, in place.

val shuffle_with : Random.State.t ‑> 'a t ‑> unit

shuffle_with rs a randomly shuffles the array a (like shuffle) but a specialized random +state rs is used to control the random numbers being produced during shuffling (for reproducibility).

val random_choose : 'a t ‑> 'a random_gen

random_choose a rs randomly chooses an element of a.

  • Raises Not_found: if the array/slice is empty.
val to_seq : 'a t ‑> 'a sequence

to_seq a returns a sequence of the elements of an array a. +The input array a is shared with the sequence and modification of it will result +in modification of the sequence.

val to_gen : 'a t ‑> 'a gen

to_gen a returns a gen of the elements of an array a.

val to_klist : 'a t ‑> 'a klist

to_klist returns a klist of the elements of an array a.

IO

val pp : ?⁠sep:string ‑> 'a printer ‑> 'a t printer

pp ~sep pp_item ppf a formats the array a on ppf. +Each element is formatted with pp_item and elements are separated +by sep (defaults to ", ").

val pp_i : ?⁠sep:string ‑> (int ‑> 'a printer) ‑> 'a t printer

pp_i ~sep pp_item ppf a prints the array a on ppf. +The printing function pp_item is giving both index and element. +Elements are separated by sep (defaults to ", ").

val map : f:('a ‑> 'b) ‑> 'a t ‑> 'b t

map ~f a applies function f to all elements of a, +and builds an array with the results returned by ~f: +[| ~f a.(0); ~f a.(1); ...; ~f a.(length a - 1) |].

val map2 : f:('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t

map2 ~f a b applies function ~f to all elements of a and b, +and builds an array with the results returned by ~f: +[| ~f a.(0) b.(0); ...; ~f a.(length a - 1) b.(length b - 1)|].

  • Raises Invalid_argument: if a and b have distinct lengths.
  • Since: 0.20
val rev : 'a t ‑> 'a t

rev a copies the array a and reverses it in place.

  • Since: 0.20
val filter : f:('a ‑> bool) ‑> 'a t ‑> 'a t

filter ~f a filters elements out of the array a. Only the elements satisfying +the given predicate ~f will be kept.

val filter_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b t

filter_map ~f [|a1; ...; an|] calls (~f a1) ... (~f an) and returns an array b consisting +of all elements bi such as ~f ai = Some bi. When ~f returns None, the corresponding +element of a is discarded.

val flat_map : f:('a ‑> 'b t) ‑> 'a t ‑> 'b array

flat_map ~f a transforms each element of a into an array, then flattens.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

a >>= f is the infix version of flat_map.

val (>>|) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

a >>| f is the infix version of map.

  • Since: 0.8
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

a >|= f is the infix version of map.

  • Since: 0.8
val except_idx : 'a t ‑> int ‑> 'a list

except_idx a i removes the element of a at given index i, and returns +the list of the other elements.

val (--) : int ‑> int ‑> int t

x -- y creates an array containing integers in the range x .. y. Bounds included.

val (--^) : int ‑> int ‑> int t

x --^ y creates an array containing integers in the range x .. y. Right bound excluded.

  • Since: 0.17
val random : 'a random_gen ‑> 'a t random_gen
val random_non_empty : 'a random_gen ‑> 'a t random_gen
val random_len : int ‑> 'a random_gen ‑> 'a t random_gen

Generic Functions

module type MONO_ARRAY : sig ... end
val sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) ‑> cmp:('elt ‑> 'elt ‑> int) ‑> 'arr ‑> unit

sort_generic (module M) ~cmp a sorts the array a, without allocating (eats stack space though). +Performance might be lower than Array.sort.

  • Since: 0.14
\ No newline at end of file diff --git a/2.3/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html b/2.3/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html new file mode 100644 index 00000000..132c122c --- /dev/null +++ b/2.3/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html @@ -0,0 +1,2 @@ + +MONO_ARRAY (containers.CCArrayLabels.MONO_ARRAY)

Module type CCArrayLabels.MONO_ARRAY

type elt
type t
val length : t ‑> int
val get : t ‑> int ‑> elt
val set : t ‑> int ‑> elt ‑> unit
\ No newline at end of file diff --git a/2.3/containers/CCArray_slice/.jbuilder-keep b/2.3/containers/CCArray_slice/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCArray_slice/index.html b/2.3/containers/CCArray_slice/index.html new file mode 100644 index 00000000..57c245d2 --- /dev/null +++ b/2.3/containers/CCArray_slice/index.html @@ -0,0 +1,59 @@ + +CCArray_slice (containers.CCArray_slice)

Module CCArray_slice

Array Slice

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a gen = unit ‑> 'a option
type 'a equal = 'a ‑> 'a ‑> bool
type 'a ord = 'a ‑> 'a ‑> int
type 'a random_gen = Random.State.t ‑> 'a
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a t

The type for an array slice, containing elements of type 'a

val empty : 'a t

empty is the empty array slice.

val equal : 'a equal ‑> 'a t equal

equal eq as1 as2 is true if the lengths of as1 and as2 are the same +and if the corresponding elements test equal using eq.

val compare : 'a ord ‑> 'a t ord

compare cmp as1 as2 compares the two slices as1 and as2 using +the comparison function cmp, element by element.

val get : 'a t ‑> int ‑> 'a

get as n returns the element number n of slice as. +The first element has number 0. +The last element has number length as - 1. +You can also write as.(n) instead of get as n.

Raise Invalid_argument "index out of bounds" +if n is outside the range 0 to (length as - 1).

val get_safe : 'a t ‑> int ‑> 'a option

get_safe as i returns Some as.(i) if i is a valid index.

  • Since: 0.18
val make : 'a array ‑> int ‑> len:int ‑> 'a t

make a i ~len creates a slice from given offset i and length len of the given array a.

  • Raises Invalid_argument: if the slice isn't valid.
val of_slice : ('a array * int * int) ‑> 'a t

of_slice (a, i, len) makes a slice from a triple (a, i, len) where a is the array, +i the offset in a, and len the number of elements of the slice.

  • Raises Invalid_argument: if the slice isn't valid (See make).
val to_slice : 'a t ‑> 'a array * int * int

to_slice as converts the slice as into a triple (a, i, len) where len is the length of +the sub-array of a starting at offset i.

val to_list : 'a t ‑> 'a list

to_list as converts the slice as directly to a list.

  • Since: 1.0
val full : 'a array ‑> 'a t

full a creates a slice that covers the full array a.

val underlying : 'a t ‑> 'a array

underlying as returns the underlying array (shared). Modifying this array will modify +the slice as.

val copy : 'a t ‑> 'a array

copy as copies the slice as into a new array.

val sub : 'a t ‑> int ‑> int ‑> 'a t

sub as i len builds a new sub-slice that contains the given subrange specified +by the index i and the length len.

val set : 'a t ‑> int ‑> 'a ‑> unit

set as n x modifies the slice as in place, replacing +element number n with x. +You can also write as.(n) <- x instead of set as n x.

Raise Invalid_argument "index out of bounds" +if n is outside the range 0 to length as - 1.

val length : _ t ‑> int

length as returns the length (number of elements) of the given slice as.

val fold : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a

fold f acc as computes f (... (f (f acc as.(0)) as.(1)) ...) as.(length as - 1).

val foldi : ('a ‑> int ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a

foldi f acc as is just like fold but it also passes in the index of each element +as the second argument to the folded function f.

val fold_while : ('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> 'a ‑> 'b t ‑> 'a

fold_while f acc as folds left on slice as until a stop condition via ('a, `Stop) +is indicated by the accumulator.

  • Since: 0.8
val iter : ('a ‑> unit) ‑> 'a t ‑> unit

iter f as applies function f in turn to all elements of as. +It is equivalent to f as.(0); f as.(1); ...; f as.(length as - 1); ().

val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

iteri f as is like iter, but the function f is applied with the index of the element +as first argument, and the element itself as second argument.

val blit : 'a t ‑> int ‑> 'a t ‑> int ‑> int ‑> unit

blit as1 o1 as2 o2 len copies len elements +from slice as1, starting at element number o1, to slice as2, +starting at element number o2. It works correctly even if +as1 and as2 are the same slice, and the source and +destination chunks overlap.

Raise Invalid_argument "CCArray_slice.blit" if o1 and len do not +designate a valid subarray of as1, or if o2 and len do not +designate a valid subarray of as2.

val reverse_in_place : 'a t ‑> unit

reverse_in_place as reverses the slice as in place.

val sorted : ('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a array

sorted cmp as makes a copy of as and sorts it with cmp.

  • Since: 1.0
val sort_indices : ('a ‑> 'a ‑> int) ‑> 'a t ‑> int array

sort_indices cmp as returns a new array b, with the same length as as, +such that b.(i) is the index at which the i-th element of sorted cmp as +appears in as. as is not modified.

In other words, map (fun i -> as.(i)) (sort_indices cmp as) = sorted cmp as. +sort_indices yields the inverse permutation of sort_ranking.

  • Since: 1.0
val sort_ranking : ('a ‑> 'a ‑> int) ‑> 'a t ‑> int array

sort_ranking cmp as returns a new array b, with the same length as as, +such that b.(i) is the index at which the i-th element of as appears +in sorted cmp as. as is not modified.

In other words, map (fun i -> (sorted cmp as).(i)) (sort_ranking cmp as) = as. +sort_ranking yields the inverse permutation of sort_indices.

In the absence of duplicate elements in as, we also have +lookup_exn as.(i) (sorted as) = (sorted_ranking as).(i).

  • Since: 1.0
val find : ('a ‑> 'b option) ‑> 'a t ‑> 'b option

find f as returns Some y if there is an element x such +that f x = Some y. Otherwise returns None.

val findi : (int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b option

findi f as is like find, but the index of the element is also passed +to the predicate function f.

  • Since: 0.3.4
val find_idx : ('a ‑> bool) ‑> 'a t ‑> (int * 'a) option

find_idx p as returns Some (i,x) where x is the i-th element of as, +and p x holds. Otherwise returns None.

  • Since: 0.3.4
val lookup : cmp:'a ord ‑> 'a ‑> 'a t ‑> int option

lookup ~cmp x as lookups the index i of some key x in the slice as, provided as is +sorted using cmp.

  • Returns None if the key x is not present, or +Some i (i the index of the key) otherwise.
val lookup_exn : cmp:'a ord ‑> 'a ‑> 'a t ‑> int

lookup_exn ~cmp x as is like lookup, but

  • Raises Not_found: if the key x is not present.
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> 'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]

bsearch ~cmp x as finds the index of the object x in the slice as, +provided as is sorted using cmp. If the slice is not sorted, +the result is not specified (may raise Invalid_argument).

Complexity: O(log n) where n is the length of the slice as +(dichotomic search).

  • Returns

    • `At i if cmp as.(i) x = 0 (for some i).
    • `All_lower if all elements of as are lower than x.
    • `All_bigger if all elements of as are bigger than x.
    • `Just_after i if as.(i) < x < as.(i+1).
    • `Empty if the slice as is empty.
  • Raises Invalid_argument: if the slice is found to be unsorted w.r.t cmp.
  • Since: 0.13
val for_all : ('a ‑> bool) ‑> 'a t ‑> bool

for_all p [|as1; ...; asn|] checks if all elements of the slice +satisfy the predicate p. That is, it returns +(p as1) && (p as2) && ... && (p asn).

val for_all2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

for_all2 p [|as1; ...; asn|] [|bs1; ...; bsn|] is true if each pair of elements asi bsi +satisfies the predicate p. +That is, it returns (p as1 bs1) && (p as2 bs2) && ... && (p asn bsn).

  • Raises Invalid_argument: if slices have distinct lengths. +Allow different types.
  • Since: 0.20
val exists : ('a ‑> bool) ‑> 'a t ‑> bool

exists p [|as1; ...; asn|] is true if at least one element of +the slice satisfies the predicate p. That is, it returns +(p as1) || (p as2) || ... || (p asn).

val exists2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

exists2 p [|as1; ...; asn|] [|bs1; ...; bsn|] is true if any pair of elements asi bsi +satisfies the predicate p. +That is, it returns (p as1 bs1) || (p as2 bs2) || ... || (p asn bsn).

  • Raises Invalid_argument: if slices have distinct lengths. +Allow different types.
  • Since: 0.20
val fold2 : ('acc ‑> 'a ‑> 'b ‑> 'acc) ‑> 'acc ‑> 'a t ‑> 'b t ‑> 'acc

fold2 f acc as bs fold on two slices as and bs stepwise. +It computes f (... (f acc as1 bs1)...) asn bsn.

  • Raises Invalid_argument: if slices have distinct lengths.
  • Since: 0.20
val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit

iter2 f as bs iterates on the two slices as and bs stepwise. +It is equivalent to f as0 bs0; ...; f as.(length as - 1) bs.(length bs - 1); ().

  • Raises Invalid_argument: if slices have distinct lengths.
  • Since: 0.20
val shuffle : 'a t ‑> unit

shuffle as randomly shuffles the slice as, in place.

val shuffle_with : Random.State.t ‑> 'a t ‑> unit

shuffle_with rs as randomly shuffles the slice as (like shuffle) but a specialized random +state rs is used to control the random numbers being produced during shuffling (for reproducibility).

val random_choose : 'a t ‑> 'a random_gen

random_choose as rs randomly chooses an element of as.

  • Raises Not_found: if the array/slice is empty.
val to_seq : 'a t ‑> 'a sequence

to_seq as returns a sequence of the elements of a slice as. +The input slice as is shared with the sequence and modification of it will result +in modification of the sequence.

val to_gen : 'a t ‑> 'a gen

to_gen as returns a gen of the elements of a slice as.

val to_klist : 'a t ‑> 'a klist

to_klist as returns a klist of the elements of a slice as.

IO

val pp : ?⁠sep:string ‑> 'a printer ‑> 'a t printer

pp ~sep pp_item ppf as formats the slice as on ppf. +Each element is formatted with pp_item and elements are separated +by sep (defaults to ", ").

val pp_i : ?⁠sep:string ‑> (int ‑> 'a printer) ‑> 'a t printer

pp_i ~sep pp_item ppf as prints the slice as on ppf. +The printing function pp_item is giving both index and element. +Elements are separated by sep (defaults to ", ").

\ No newline at end of file diff --git a/2.3/containers/CCBV/.jbuilder-keep b/2.3/containers/CCBV/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCBV/index.html b/2.3/containers/CCBV/index.html new file mode 100644 index 00000000..53db330d --- /dev/null +++ b/2.3/containers/CCBV/index.html @@ -0,0 +1,18 @@ + +CCBV (containers.CCBV)

Module CCBV

Imperative Bitvectors

BREAKING CHANGES since 1.2: +size is now stored along with the bitvector. Some functions have +a new signature.

The size of the bitvector used to be rounded up to the multiple of 30 or 62. +In other words some functions such as iter would iterate on more +bits than what was originally asked for. This is not the case anymore.

type t

A resizable bitvector

val empty : unit ‑> t

Empty bitvector.

val create : size:int ‑> bool ‑> t

Create a bitvector of given size, with given default value.

val copy : t ‑> t

Copy of bitvector.

val cardinal : t ‑> int

Number of bits set to one, seen as a set of bits.

val length : t ‑> int

Size of underlying bitvector. +This is not related to the underlying implementation. +Changed at 1.2

val capacity : t ‑> int

The number of bits this bitvector can store without resizing.

  • Since: 1.2
val resize : t ‑> int ‑> unit

Resize the BV so that it has the specified length. This can grow or shrink +the underlying bitvector.

  • Raises Invalid_arg: on negative sizes.
val is_empty : t ‑> bool

Are there any true bits?

val set : t ‑> int ‑> unit

Set i-th bit, extending the bitvector if needed.

val get : t ‑> int ‑> bool

Is the i-th bit true? Return false if the index is too high.

val reset : t ‑> int ‑> unit

Set i-th bit to 0, extending the bitvector if needed.

val flip : t ‑> int ‑> unit

Flip i-th bit, extending the bitvector if needed.

val clear : t ‑> unit

Set every bit to 0.

val iter : t ‑> (int ‑> bool ‑> unit) ‑> unit

Iterate on all bits.

val iter_true : t ‑> (int ‑> unit) ‑> unit

Iterate on bits set to 1.

val to_list : t ‑> int list

List of indexes that are true.

val to_sorted_list : t ‑> int list

Same as to_list, but also guarantees the list is sorted in +increasing order.

val of_list : int list ‑> t

From a list of true bits.

The bits are interpreted as indices into the returned bitvector, so the final +bitvector will have length t equal to 1 more than max of list indices.

val first : t ‑> int option

First set bit, or return None. +Changed type at 1.2

val first_exn : t ‑> int

First set bit, or

  • Raises Not_found: if all bits are 0.
  • Since: 1.2
val filter : t ‑> (int ‑> bool) ‑> unit

filter bv p only keeps the true bits of bv whose index +satisfies p index.

val negate_self : t ‑> unit

negate_self t flips all of the bits in t.

  • Since: 1.2
val negate : t ‑> t

negate t returns a copy of t with all of the bits flipped.

val union_into : into:t ‑> t ‑> unit

union_into ~into bv sets into to the union of itself and bv. +Also updates the length of into to be at least length bv.

val inter_into : into:t ‑> t ‑> unit

inter_into ~into bv sets into to the intersection of itself and bv. +Also updates the length of into to be at most length bv.

val union : t ‑> t ‑> t

union bv1 bv2 returns the union of the two sets.

val inter : t ‑> t ‑> t

inter bv1 bv2 returns the intersection of the two sets.

val diff_into : into:t ‑> t ‑> unit

diff_into ~into t modifies into with only the bits set but not in t.

  • Since: 1.2
val diff : t ‑> t ‑> t

diff t1 t2 returns those bits found in t1 but not in t2.

  • Since: 1.2
val select : t ‑> 'a array ‑> 'a list

select arr bv selects the elements of arr whose index +corresponds to a true bit in bv. If bv is too short, elements of arr +with too high an index cannot be selected and are therefore not +selected.

val selecti : t ‑> 'a array ‑> ('a * int) list

Same as select, but selected elements are paired with their indexes.

type 'a sequence = ('a ‑> unit) ‑> unit
val to_seq : t ‑> int sequence
val of_seq : int sequence ‑> t
val pp : Format.formatter ‑> t ‑> unit

Print the bitvector as a string of bits.

  • Since: 0.13
\ No newline at end of file diff --git a/2.3/containers/CCBijection/.jbuilder-keep b/2.3/containers/CCBijection/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCBijection/Make/argument-1-L/index.html b/2.3/containers/CCBijection/Make/argument-1-L/index.html new file mode 100644 index 00000000..ff6a760f --- /dev/null +++ b/2.3/containers/CCBijection/Make/argument-1-L/index.html @@ -0,0 +1,2 @@ + +1-L (containers.CCBijection.Make.1-L)

Parameter CCBijection.Make.1-L

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCBijection/Make/argument-2-R/index.html b/2.3/containers/CCBijection/Make/argument-2-R/index.html new file mode 100644 index 00000000..ac460337 --- /dev/null +++ b/2.3/containers/CCBijection/Make/argument-2-R/index.html @@ -0,0 +1,2 @@ + +2-R (containers.CCBijection.Make.2-R)

Parameter CCBijection.Make.2-R

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCBijection/Make/index.html b/2.3/containers/CCBijection/Make/index.html new file mode 100644 index 00000000..3d052b83 --- /dev/null +++ b/2.3/containers/CCBijection/Make/index.html @@ -0,0 +1,7 @@ + +Make (containers.CCBijection.Make)

Module CCBijection.Make

Parameters

Signature

type t
type left = L.t
type right = R.t
val empty : t
val is_empty : t ‑> bool
val equal : t ‑> t ‑> bool
val compare : t ‑> t ‑> int
val add : left ‑> right ‑> t ‑> t

Add left and right correspondence to bijection such that +left and right are unique in their respective sets and only +correspond to each other.

val cardinal : t ‑> int

Number of bindings. O(n) time.

val mem : left ‑> right ‑> t ‑> bool

Check both sides for key membership.

val mem_left : left ‑> t ‑> bool

Check for membership of correspondence using left key.

val mem_right : right ‑> t ‑> bool

Check for membership of correspondence using right key.

val find_left : left ‑> t ‑> right
  • Raises Not_found: if left is not found.
val find_right : right ‑> t ‑> left
  • Raises Not_found: if right is not found.
val remove : left ‑> right ‑> t ‑> t

Remove the left, right binding if it exists. Return the +same bijection otherwise.

val remove_left : left ‑> t ‑> t

Remove the binding with left key if it exists. Return the +same bijection otherwise.

val remove_right : right ‑> t ‑> t

Remove the binding with right key if it exists. Return the +same bijection otherwise.

val list_left : t ‑> (left * right) list

Return the bindings as a list of (left, right) values.

val list_right : t ‑> (right * left) list

Return the bindings as a list of (right, left) values.

val add_seq : (left * right) sequence ‑> t ‑> t
val of_seq : (left * right) sequence ‑> t
val to_seq : t ‑> (left * right) sequence
val add_list : (left * right) list ‑> t ‑> t
val of_list : (left * right) list ‑> t
val to_list : t ‑> (left * right) list
\ No newline at end of file diff --git a/2.3/containers/CCBijection/index.html b/2.3/containers/CCBijection/index.html new file mode 100644 index 00000000..8bcbc483 --- /dev/null +++ b/2.3/containers/CCBijection/index.html @@ -0,0 +1,4 @@ + +CCBijection (containers.CCBijection)

Module CCBijection

Bijection

+Represents 1-to-1 mappings between two types. Each element from the "left" +is mapped to one "right" value, and conversely.

type 'a sequence = ('a ‑> unit) ‑> unit
module type OrderedType : sig ... end
module type S : sig ... end
module Make : functor (L : OrderedType) -> functor (R : OrderedType) -> S with type left = L.t and type right = R.t
\ No newline at end of file diff --git a/2.3/containers/CCBijection/module-type-OrderedType/index.html b/2.3/containers/CCBijection/module-type-OrderedType/index.html new file mode 100644 index 00000000..c54fe187 --- /dev/null +++ b/2.3/containers/CCBijection/module-type-OrderedType/index.html @@ -0,0 +1,2 @@ + +OrderedType (containers.CCBijection.OrderedType)

Module type CCBijection.OrderedType

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCBijection/module-type-S/index.html b/2.3/containers/CCBijection/module-type-S/index.html new file mode 100644 index 00000000..972ef52c --- /dev/null +++ b/2.3/containers/CCBijection/module-type-S/index.html @@ -0,0 +1,7 @@ + +S (containers.CCBijection.S)

Module type CCBijection.S

type t
type left
type right
val empty : t
val is_empty : t ‑> bool
val equal : t ‑> t ‑> bool
val compare : t ‑> t ‑> int
val add : left ‑> right ‑> t ‑> t

Add left and right correspondence to bijection such that +left and right are unique in their respective sets and only +correspond to each other.

val cardinal : t ‑> int

Number of bindings. O(n) time.

val mem : left ‑> right ‑> t ‑> bool

Check both sides for key membership.

val mem_left : left ‑> t ‑> bool

Check for membership of correspondence using left key.

val mem_right : right ‑> t ‑> bool

Check for membership of correspondence using right key.

val find_left : left ‑> t ‑> right
  • Raises Not_found: if left is not found.
val find_right : right ‑> t ‑> left
  • Raises Not_found: if right is not found.
val remove : left ‑> right ‑> t ‑> t

Remove the left, right binding if it exists. Return the +same bijection otherwise.

val remove_left : left ‑> t ‑> t

Remove the binding with left key if it exists. Return the +same bijection otherwise.

val remove_right : right ‑> t ‑> t

Remove the binding with right key if it exists. Return the +same bijection otherwise.

val list_left : t ‑> (left * right) list

Return the bindings as a list of (left, right) values.

val list_right : t ‑> (right * left) list

Return the bindings as a list of (right, left) values.

val add_seq : (left * right) sequence ‑> t ‑> t
val of_seq : (left * right) sequence ‑> t
val to_seq : t ‑> (left * right) sequence
val add_list : (left * right) list ‑> t ‑> t
val of_list : (left * right) list ‑> t
val to_list : t ‑> (left * right) list
\ No newline at end of file diff --git a/2.3/containers/CCBitField/.jbuilder-keep b/2.3/containers/CCBitField/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCBitField/Make/argument-1-X/index.html b/2.3/containers/CCBitField/Make/argument-1-X/index.html new file mode 100644 index 00000000..05089fc6 --- /dev/null +++ b/2.3/containers/CCBitField/Make/argument-1-X/index.html @@ -0,0 +1,2 @@ + +1-X (containers.CCBitField.Make.1-X)

Parameter CCBitField.Make.1-X

\ No newline at end of file diff --git a/2.3/containers/CCBitField/Make/index.html b/2.3/containers/CCBitField/Make/index.html new file mode 100644 index 00000000..dc901307 --- /dev/null +++ b/2.3/containers/CCBitField/Make/index.html @@ -0,0 +1,4 @@ + +Make (containers.CCBitField.Make)

Module CCBitField.Make

Create a new bitfield type

Parameters

X : sig ... end

Signature

type t = private int

Generative type of bitfields. Each instantiation of the functor +should create a new, incompatible type

val empty : t

Empty bitfields (all bits 0).

type field
val get : field ‑> t ‑> bool

Get the value of this field.

val set : field ‑> bool ‑> t ‑> t

Set the value of this field.

val mk_field : unit ‑> field

Make a new field.

val freeze : unit ‑> unit

Prevent new fields from being added. From now on, creating +a field will raise Frozen.

val total_width : unit ‑> int

Current width of the bitfield.

\ No newline at end of file diff --git a/2.3/containers/CCBitField/index.html b/2.3/containers/CCBitField/index.html new file mode 100644 index 00000000..4c79178b --- /dev/null +++ b/2.3/containers/CCBitField/index.html @@ -0,0 +1,15 @@ + +CCBitField (containers.CCBitField)

Module CCBitField

Bit Field

This module defines efficient bitfields +up to 30 or 62 bits (depending on the architecture) in +a relatively type-safe way.

      module B = CCBitField.Make(struct end);;
+
+      let x = B.mk_field ()
+      let y = B.mk_field ()
+      let z = B.mk_field ()
+
+      let f = B.empty |> B.set x true |> B.set y true;;
+
+      assert (not (B.get z f)) ;;
+
+      assert (f |> B.set z true |> B.get z);;
+
exception TooManyFields

Raised when too many fields are packed into one bitfield.

exception Frozen

Raised when a frozen bitfield is modified.

val max_width : int

System-dependent maximum width for a bitfield, typically 30 or 62.

module type S : sig ... end

Bitfield Signature

module Make : functor (X : sig ... end) -> S

Create a new bitfield type

\ No newline at end of file diff --git a/2.3/containers/CCBitField/module-type-S/index.html b/2.3/containers/CCBitField/module-type-S/index.html new file mode 100644 index 00000000..369b4291 --- /dev/null +++ b/2.3/containers/CCBitField/module-type-S/index.html @@ -0,0 +1,4 @@ + +S (containers.CCBitField.S)

Module type CCBitField.S

Bitfield Signature

type t = private int

Generative type of bitfields. Each instantiation of the functor +should create a new, incompatible type

val empty : t

Empty bitfields (all bits 0).

type field
val get : field ‑> t ‑> bool

Get the value of this field.

val set : field ‑> bool ‑> t ‑> t

Set the value of this field.

val mk_field : unit ‑> field

Make a new field.

val freeze : unit ‑> unit

Prevent new fields from being added. From now on, creating +a field will raise Frozen.

val total_width : unit ‑> int

Current width of the bitfield.

\ No newline at end of file diff --git a/2.3/containers/CCBlockingQueue/.jbuilder-keep b/2.3/containers/CCBlockingQueue/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCBlockingQueue/index.html b/2.3/containers/CCBlockingQueue/index.html new file mode 100644 index 00000000..49c997ce --- /dev/null +++ b/2.3/containers/CCBlockingQueue/index.html @@ -0,0 +1,9 @@ + +CCBlockingQueue (containers.CCBlockingQueue)

Module CCBlockingQueue

Blocking Queue

This queue has a limited size. Pushing a value on the queue when it +is full will block.

type 'a t

Safe-thread queue for values of type 'a

val create : int ‑> 'a t

Create a new queue of size n. Using n=max_int amounts to using +an infinite queue (2^61 items is a lot to fit in memory); using n=1 +amounts to using a box with 0 or 1 elements inside.

  • Raises Invalid_argument: if n < 1.
val push : 'a t ‑> 'a ‑> unit

push q x pushes x into q, blocking if the queue is full.

val take : 'a t ‑> 'a

Take the first element, blocking if needed.

val push_list : 'a t ‑> 'a list ‑> unit

Push items of the list, one by one.

val take_list : 'a t ‑> int ‑> 'a list

take_list n q takes n elements out of q.

val try_take : 'a t ‑> 'a option

Take the first element if the queue is not empty, return None +otherwise.

val try_push : 'a t ‑> 'a ‑> bool

try_push q x pushes x into q if q is not full, in which +case it returns true. +If it fails because q is full, it returns false.

val peek : 'a t ‑> 'a option

peek q returns Some x if x is the first element of q, +otherwise it returns None.

val size : _ t ‑> int

Number of elements currently in the queue.

val capacity : _ t ‑> int

Number of values the queue can hold.

\ No newline at end of file diff --git a/2.3/containers/CCBool/.jbuilder-keep b/2.3/containers/CCBool/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCBool/index.html b/2.3/containers/CCBool/index.html new file mode 100644 index 00000000..fb335818 --- /dev/null +++ b/2.3/containers/CCBool/index.html @@ -0,0 +1,2 @@ + +CCBool (containers.CCBool)

Module CCBool

Basic Bool functions

type t = bool
val compare : t ‑> t ‑> int

Total ordering on booleans, similar to Pervasives.compare.

val equal : t ‑> t ‑> bool
val negate : t ‑> t

Negation on booleans (functional version of not).

  • Deprecated since 1.3, simply use not instead.
type 'a printer = Format.formatter ‑> 'a ‑> unit
val pp : t printer
\ No newline at end of file diff --git a/2.3/containers/CCCache/.jbuilder-keep b/2.3/containers/CCCache/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCCache/index.html b/2.3/containers/CCCache/index.html new file mode 100644 index 00000000..15e1fc04 --- /dev/null +++ b/2.3/containers/CCCache/index.html @@ -0,0 +1,38 @@ + +CCCache (containers.CCCache)

Module CCCache

Caches

Particularly useful for memoization. See with_cache and with_cache_rec +for more details.

type 'a equal = 'a ‑> 'a ‑> bool
type 'a hash = 'a ‑> int

Value interface

Typical use case: one wants to memoize a function f : 'a -> 'b. Code sample: +

      let f x =
+        print_endline "call f";
+        x + 1;;
+
+      let f' = with_cache (lru 256) f;;
+      f' 0;;  (* prints *)
+      f' 1;;  (* prints *)
+      f' 0;;  (* doesn't print, returns cached value *)
type ('a, 'b) t
val clear : (__t ‑> unit

Clear the content of the cache.

type ('a, 'b) callback = in_cache:bool ‑> 'a ‑> 'b ‑> unit

Type of the callback that is called once a cached value is found +or not. +Should never raise.

  • Parameter in_cache: is true if the value was in cache, false +if the value was just produced.
  • Since: 1.3
val with_cache : ?⁠cb:('a'bcallback ‑> ('a'bt ‑> ('a ‑> 'b) ‑> 'a ‑> 'b

with_cache c f behaves like f, but caches calls to f in the +cache c. It always returns the same value as +f x, if f x returns, or raise the same exception. +However, f may not be called if x is in the cache.

  • Parameter cb: called after the value is generated or retrieved.
val with_cache_rec : ?⁠cb:('a'bcallback ‑> ('a'bt ‑> (('a ‑> 'b) ‑> 'a ‑> 'b) ‑> 'a ‑> 'b

with_cache_rec c f is a function that first, applies f to +some f' = fix f, such that recursive calls to f' are cached in c. +It is similar to with_cache but with a function that takes as +first argument its own recursive version. +Example (memoized Fibonacci function): +

      let fib = with_cache_rec (lru 256)
+          (fun fib' n -> match n with
+             | 1 | 2 -> 1
+             | _ -> fib' (n-1) + fib' (n-2)
+          );;
+
+      fib 70;;
  • Parameter cb: called after the value is generated or retrieved.
val size : (__t ‑> int

Size of the cache (number of entries). At most linear in the number +of entries.

val iter : ('a'bt ‑> ('a ‑> 'b ‑> unit) ‑> unit

Iterate on cached values. Should yield size cache pairs.

val add : ('a'bt ‑> 'a ‑> 'b ‑> bool

Manually add a cached value. Return true if the value has successfully +been added, and false if the value was already bound.

  • Since: 1.5
val dummy : ('a'bt

Dummy cache, never stores any value.

val linear : eq:'a equal ‑> int ‑> ('a'bt

Linear cache with the given size. It stores key/value pairs in +an array and does linear search at every call, so it should only be used +with small size.

  • Parameter eq: optional equality predicate for keys.
val replacing : eq:'a equal ‑> ?⁠hash:'a hash ‑> int ‑> ('a'bt

Replacing cache of the given size. Equality and hash functions can be +parametrized. It's a hash table that handles collisions by replacing +the old value with the new (so a cache entry is evicted when another +entry with the same hash (modulo size) is added). +Never grows wider than the given size.

val lru : eq:'a equal ‑> ?⁠hash:'a hash ‑> int ‑> ('a'bt

LRU cache of the given size ("Least Recently Used": keys that have not been +used recently are deleted first). Never grows wider than the given size.

val unbounded : eq:'a equal ‑> ?⁠hash:'a hash ‑> int ‑> ('a'bt

Unbounded cache, backed by a Hash table. Will grow forever +unless clear is called manually.

\ No newline at end of file diff --git a/2.3/containers/CCChar/.jbuilder-keep b/2.3/containers/CCChar/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCChar/index.html b/2.3/containers/CCChar/index.html new file mode 100644 index 00000000..34ab697a --- /dev/null +++ b/2.3/containers/CCChar/index.html @@ -0,0 +1,9 @@ + +CCChar (containers.CCChar)

Module CCChar

Utils around char

include module type of sig ... end
external code : char ‑> int = "%identity"
val chr : int ‑> char
val escaped : char ‑> string
val lowercase : char ‑> char
  • Deprecated Use Char.lowercase_ascii instead.
val uppercase : char ‑> char
  • Deprecated Use Char.uppercase_ascii instead.
val lowercase_ascii : char ‑> char
val uppercase_ascii : char ‑> char
type t = char
val compare : t ‑> t ‑> int
val equal : t ‑> t ‑> bool
external unsafe_chr : int ‑> char = "%identity"
val equal : t ‑> t ‑> bool

The equal function for chars.

val compare : t ‑> t ‑> int

The comparison function for characters, with the same specification as +Pervasives.compare. Along with the type t, this function compare +allows the module Char to be passed as argument to the functors +Set.Make and Map.Make.

val lowercase_ascii : t ‑> t

Convert the given character to its equivalent lowercase character, +using the US-ASCII character set.

  • Since: 0.20
val uppercase_ascii : t ‑> t

Convert the given character to its equivalent uppercase character, +using the US-ASCII character set.

  • Since: 0.20
val of_int_exn : int ‑> t

Alias to Char.chr. +Return the character with the given ASCII code.

  • Raises Invalid_argument: if the int is not within 0,...,255.
  • Since: 1.0
val of_int : int ‑> t option

Safe version of of_int_exn.

  • Since: 1.0
val to_int : t ‑> int

Alias to Char.code. +Return the ASCII code of the argument.

  • Since: 1.0
val pp_buf : Buffer.t ‑> t ‑> unit

Renamed from pp since 2.0.

val pp : Format.formatter ‑> t ‑> unit

Renamed from print since 2.0.

\ No newline at end of file diff --git a/2.3/containers/CCDeque/.jbuilder-keep b/2.3/containers/CCDeque/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCDeque/index.html b/2.3/containers/CCDeque/index.html new file mode 100644 index 00000000..004f4d85 --- /dev/null +++ b/2.3/containers/CCDeque/index.html @@ -0,0 +1,13 @@ + +CCDeque (containers.CCDeque)

Module CCDeque

Imperative deque

This structure provides fast access to its front and back elements, +with O(1) operations.

type 'a t

Contains 'a elements, queue in both ways

exception Empty
val create : unit ‑> 'a t

New deque.

val clear : _ t ‑> unit

Remove all elements.

  • Since: 0.13
val is_empty : 'a t ‑> bool

Is the deque empty?

val equal : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool

equal a b checks whether a and b contain the same sequence of +elements.

  • Parameter eq: comparison function for elements.
  • Since: 0.13
val compare : cmp:('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a t ‑> int

compare a b compares lexicographically a and b.

  • Parameter cmp: comparison function for elements.
  • Since: 0.13
val length : 'a t ‑> int

Number of elements. +Used to be linear time, now constant time.

val push_front : 'a t ‑> 'a ‑> unit

Push value at the front.

val push_back : 'a t ‑> 'a ‑> unit

Push value at the back.

val peek_front : 'a t ‑> 'a

First value.

  • Raises Empty: if empty.
val peek_back : 'a t ‑> 'a

Last value.

  • Raises Empty: if empty.
val take_back : 'a t ‑> 'a

Take last value.

  • Raises Empty: if empty.
val take_front : 'a t ‑> 'a

Take first value.

  • Raises Empty: if empty.
val append_front : into:'a t ‑> 'a t ‑> unit

append_front ~into q adds all elements of q at the front +of into. +O(length q) in time.

  • Since: 0.13
val append_back : into:'a t ‑> 'a t ‑> unit

append_back ~into q adds all elements of q at the back of into. +O(length q) in time.

  • Since: 0.13
val iter : ('a ‑> unit) ‑> 'a t ‑> unit

Iterate on elements.

val fold : ('b ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

Fold on elements.

  • Since: 0.13

Conversions

type 'a gen = unit ‑> 'a option
type 'a sequence = ('a ‑> unit) ‑> unit
val of_seq : 'a sequence ‑> 'a t

Create a deque from the sequence. +Optional argument deque disappears, use add_seq_back instead.

  • Since: 0.13
val to_seq : 'a t ‑> 'a sequence

Iterate on the elements.

val of_gen : 'a gen ‑> 'a t

of_gen g makes a deque containing the elements of g.

  • Since: 0.13
val to_gen : 'a t ‑> 'a gen

Iterate on the elements of the deque.

  • Since: 0.13
val add_seq_front : 'a t ‑> 'a sequence ‑> unit

add_seq_front q seq adds elements of seq into the front of q, +in reverse order. +O(n) in time, where n is the number of elements to add.

  • Since: 0.13
val add_seq_back : 'a t ‑> 'a sequence ‑> unit

add_seq_back q seq adds elements of seq into the back of q, +in order. +O(n) in time, where n is the number of elements to add.

  • Since: 0.13
val copy : 'a t ‑> 'a t

Fresh copy, O(n) in time.

val of_list : 'a list ‑> 'a t

Conversion from list, in order.

  • Since: 0.13
val to_list : 'a t ‑> 'a list

List of elements, in order. Less efficient than to_rev_list.

  • Since: 0.13
val to_rev_list : 'a t ‑> 'a list

Efficient conversion to list, in reverse order.

  • Since: 0.13

print

type 'a printer = Format.formatter ‑> 'a ‑> unit
val pp : 'a printer ‑> 'a t printer

Print the elements.

  • Since: 0.13
\ No newline at end of file diff --git a/2.3/containers/CCEqual/.jbuilder-keep b/2.3/containers/CCEqual/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCEqual/Infix/index.html b/2.3/containers/CCEqual/Infix/index.html new file mode 100644 index 00000000..a69ba8ed --- /dev/null +++ b/2.3/containers/CCEqual/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCEqual.Infix)

Module CCEqual.Infix

val (>|=) : 'b t ‑> ('a ‑> 'b) ‑> 'a t

Infix equivalent of map.

\ No newline at end of file diff --git a/2.3/containers/CCEqual/index.html b/2.3/containers/CCEqual/index.html new file mode 100644 index 00000000..916a3d3d --- /dev/null +++ b/2.3/containers/CCEqual/index.html @@ -0,0 +1,7 @@ + +CCEqual (containers.CCEqual)

Module CCEqual

Equality Combinators

type 'a t = 'a ‑> 'a ‑> bool

Equality function. Must be transitive, symmetric, and reflexive.

val poly : 'a t

Standard polymorphic equality.

val physical : 'a t

Standard physical equality.

  • Since: 2.0
val int : int t
val string : string t
val bool : bool t
val float : float t
val unit : unit t
val list : 'a t ‑> 'a list t
val array : 'a t ‑> 'a array t
val option : 'a t ‑> 'a option t
val pair : 'a t ‑> 'b t ‑> ('a * 'b) t
val triple : 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t
val map : ('a ‑> 'b) ‑> 'b t ‑> 'a t

map f eq is the equality function that, given objects x and y, +projects x and y using f (e.g. using a record field) and then +compares those projections with eq. +Example: +map fst int compares values of type (int * 'a) by their +first component.

module Infix : sig ... end
include module type of Infix
val (>|=) : 'b t ‑> ('a ‑> 'b) ‑> 'a t

Infix equivalent of map.

\ No newline at end of file diff --git a/2.3/containers/CCFQueue/.jbuilder-keep b/2.3/containers/CCFQueue/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCFQueue/index.html b/2.3/containers/CCFQueue/index.html new file mode 100644 index 00000000..1a2a5590 --- /dev/null +++ b/2.3/containers/CCFQueue/index.html @@ -0,0 +1,8 @@ + +CCFQueue (containers.CCFQueue)

Module CCFQueue

Functional queues

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a equal = 'a ‑> 'a ‑> bool
type 'a printer = Format.formatter ‑> 'a ‑> unit

Basics

type +'a t

Queue containing elements of type 'a

val empty : 'a t
val is_empty : 'a t ‑> bool
val singleton : 'a ‑> 'a t
val doubleton : 'a ‑> 'a ‑> 'a t
exception Empty
val cons : 'a ‑> 'a t ‑> 'a t

Push element at the front of the queue.

val snoc : 'a t ‑> 'a ‑> 'a t

Push element at the end of the queue.

val take_front : 'a t ‑> ('a * 'a t) option

Get and remove the first element.

val take_front_exn : 'a t ‑> 'a * 'a t

Same as take_front, but fails on empty queues.

  • Raises Empty: if the queue is empty.
val take_front_l : int ‑> 'a t ‑> 'a list * 'a t

take_front_l n q takes at most n elements from the front +of q, and returns them wrapped in a list.

  • Raises Invalid_argument: if n<0.
val take_front_while : ('a ‑> bool) ‑> 'a t ‑> 'a list * 'a t
val take_back : 'a t ‑> ('a t * 'a) option

Take last element.

val take_back_exn : 'a t ‑> 'a t * 'a

Same as take_back, but fails on empty queues.

  • Raises Empty: if the queue is empty.
val take_back_l : int ‑> 'a t ‑> 'a t * 'a list

take_back_l n q removes and returns the last n elements of q. The +elements are in the order of the queue, that is, the head of the returned +list is the first element to appear via take_front. +take_back_l 2 (of_list [1;2;3;4]) = of_list [1;2], [3;4].

  • Raises Invalid_argument: if n<0.
val take_back_while : ('a ‑> bool) ‑> 'a t ‑> 'a t * 'a list

Individual extraction

val first : 'a t ‑> 'a option

First element of the queue.

val last : 'a t ‑> 'a option

Last element of the queue.

val first_exn : 'a t ‑> 'a

Same as first but

  • Raises Empty: if the queue is empty.
val last_exn : 'a t ‑> 'a
val nth : int ‑> 'a t ‑> 'a option

Return the i-th element of the queue in logarithmic time.

val nth_exn : int ‑> 'a t ‑> 'a

Unsafe version of nth.

  • Raises Not_found: if the index is wrong.
val tail : 'a t ‑> 'a t

Queue deprived of its first element. Does nothing on empty queues.

val init : 'a t ‑> 'a t

Queue deprived of its last element. Does nothing on empty queues.

Global Operations

val append : 'a t ‑> 'a t ‑> 'a t

Append two queues. Elements from the second one come +after elements of the first one. +Linear in the size of the second queue.

val rev : 'a t ‑> 'a t

Reverse the queue, O(n) complexity.

  • Since: 0.10
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Map values.

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Synonym to map.

val size : 'a t ‑> int

Number of elements in the queue (constant time).

val fold : ('b ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b
val iter : ('a ‑> unit) ‑> 'a t ‑> unit
val equal : 'a equal ‑> 'a t equal

Conversions

val of_list : 'a list ‑> 'a t
val to_list : 'a t ‑> 'a list
val add_seq_front : 'a sequence ‑> 'a t ‑> 'a t
val add_seq_back : 'a t ‑> 'a sequence ‑> 'a t
val to_seq : 'a t ‑> 'a sequence
val of_seq : 'a sequence ‑> 'a t
val to_klist : 'a t ‑> 'a klist
val of_klist : 'a klist ‑> 'a t
val (--) : int ‑> int ‑> int t

a -- b is the integer range from a to b, both included.

  • Since: 0.10
val (--^) : int ‑> int ‑> int t

a -- b is the integer range from a to b, where b is excluded.

  • Since: 0.17
val pp : 'a printer ‑> 'a t printer
  • Since: 0.13
\ No newline at end of file diff --git a/2.3/containers/CCFloat/.jbuilder-keep b/2.3/containers/CCFloat/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCFloat/Infix/index.html b/2.3/containers/CCFloat/Infix/index.html new file mode 100644 index 00000000..6d8c0861 --- /dev/null +++ b/2.3/containers/CCFloat/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCFloat.Infix)

Module CCFloat.Infix

val (=) : t ‑> t ‑> bool
  • Since: 0.17
val (<>) : t ‑> t ‑> bool
  • Since: 0.17
val (<) : t ‑> t ‑> bool
  • Since: 0.17
val (>) : t ‑> t ‑> bool
  • Since: 0.17
val (<=) : t ‑> t ‑> bool
  • Since: 0.17
val (>=) : t ‑> t ‑> bool
  • Since: 0.17
val (+) : t ‑> t ‑> t

Addition.

  • Since: 2.1
val (-) : t ‑> t ‑> t

Subtraction.

  • Since: 2.1
val (~-) : t ‑> t

Unary negation.

  • Since: 2.1
val (*) : t ‑> t ‑> t

Multiplication.

  • Since: 2.1
val (/) : t ‑> t ‑> t

Division.

  • Since: 2.1
\ No newline at end of file diff --git a/2.3/containers/CCFloat/index.html b/2.3/containers/CCFloat/index.html new file mode 100644 index 00000000..8b74ab5b --- /dev/null +++ b/2.3/containers/CCFloat/index.html @@ -0,0 +1,8 @@ + +CCFloat (containers.CCFloat)

Module CCFloat

Basic operations on floating-point numbers

type t = float
type fpclass = Pervasives.fpclass =
| FP_normal
| FP_subnormal
| FP_zero
| FP_infinite
| FP_nan
val nan : t

Equal to Pervasives.nan.

val max_value : t

Positive infinity. Equal to Pervasives.infinity.

val min_value : t

Negative infinity. Equal to Pervasives.neg_infinity.

val max_finite_value : t

Equal to Pervasives.max_float.

val epsilon : t

The smallest positive float x such that 1.0 +. x <> 1.0. +Equal to Pervasives.epsilon_float.

val is_nan : t ‑> bool

is_nan f returns true if f is NaN, false otherwise.

val add : t ‑> t ‑> t

Equal to (+.).

val sub : t ‑> t ‑> t

Equal to (-.).

val neg : t ‑> t

Equal to (~-.).

val abs : t ‑> t

The absolute value of a floating-point number. +Equal to Pervasives.abs_float.

val scale : t ‑> t ‑> t

Equal to ( *. ).

val min : t ‑> t ‑> t
val max : t ‑> t ‑> t
val equal : t ‑> t ‑> bool
val compare : t ‑> t ‑> int
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a random_gen = Random.State.t ‑> 'a
val pp : t printer
val hash : t ‑> int
val random : t ‑> t random_gen
val random_small : t random_gen
val random_range : t ‑> t ‑> t random_gen
val fsign : t ‑> t

fsign x is one of -1., -0., +0., +1., or nan if x is NaN.

  • Since: 0.7
val round : t ‑> t

round f returns the closest integer value, either above or below.

  • Since: 0.20
exception TrapNaN of string
val sign_exn : t ‑> int

sign_exn x will return the sign of x as 1, 0 or -1, or raise an +exception TrapNaN if x is NaN. +Note that infinities have defined signs in OCaml.

  • Since: 0.7
val to_int : t ‑> int

Alias to int_of_float. +Unspecified if outside of the range of integers.

val of_int : int ‑> t

Alias to float_of_int.

val to_string : t ‑> string
val of_string_exn : string ‑> t

Alias to float_of_string.

  • Raises Failure: in case of failure.
  • Since: 1.2
val of_string : string ‑> t

Alias to float_of_string.

  • Deprecated since 1.2, use of_string_exn instead.
  • Raises Failure: in case of failure.
val equal_precision : epsilon:t ‑> t ‑> t ‑> bool

Equality with allowed error up to a non negative epsilon value.

val classify : t ‑> fpclass

Return the class of the given floating-point number: +normal, subnormal, zero, infinite or nan (not a number).

Infix Operators

module Infix : sig ... end
include module type of Infix
val (=) : t ‑> t ‑> bool
  • Since: 0.17
val (<>) : t ‑> t ‑> bool
  • Since: 0.17
val (<) : t ‑> t ‑> bool
  • Since: 0.17
val (>) : t ‑> t ‑> bool
  • Since: 0.17
val (<=) : t ‑> t ‑> bool
  • Since: 0.17
val (>=) : t ‑> t ‑> bool
  • Since: 0.17
val (+) : t ‑> t ‑> t

Addition.

  • Since: 2.1
val (-) : t ‑> t ‑> t

Subtraction.

  • Since: 2.1
val (~-) : t ‑> t

Unary negation.

  • Since: 2.1
val (*) : t ‑> t ‑> t

Multiplication.

  • Since: 2.1
val (/) : t ‑> t ‑> t

Division.

  • Since: 2.1
\ No newline at end of file diff --git a/2.3/containers/CCFormat/.jbuilder-keep b/2.3/containers/CCFormat/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCFormat/Dump/index.html b/2.3/containers/CCFormat/Dump/index.html new file mode 100644 index 00000000..b488489f --- /dev/null +++ b/2.3/containers/CCFormat/Dump/index.html @@ -0,0 +1,2 @@ + +Dump (containers.CCFormat.Dump)

Module CCFormat.Dump

type 'a t = 'a printer
val unit : unit t
val int : int t
val string : string t
val bool : bool t
val float : float t
val char : char t
val int32 : int32 t
val int64 : int64 t
val nativeint : nativeint t
val list : 'a t ‑> 'a list t
val array : 'a t ‑> 'a array t
val option : 'a t ‑> 'a option t
val pair : 'a t ‑> 'b t ‑> ('a * 'b) t
val triple : 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t
val quad : 'a t ‑> 'b t ‑> 'c t ‑> 'd t ‑> ('a * 'b * 'c * 'd) t
val result : 'a t ‑> ('a, string) Result.result t
val result' : 'a t ‑> 'e t ‑> ('a'e) Result.result t
val to_string : 'a t ‑> 'a ‑> string
\ No newline at end of file diff --git a/2.3/containers/CCFormat/index.html b/2.3/containers/CCFormat/index.html new file mode 100644 index 00000000..d6eae4cd --- /dev/null +++ b/2.3/containers/CCFormat/index.html @@ -0,0 +1,44 @@ + +CCFormat (containers.CCFormat)

Module CCFormat

Helpers for Format

type 'a sequence = ('a ‑> unit) ‑> unit
include module type of sig ... end
type formatter = Format.formatter
val pp_open_box : formatter ‑> int ‑> unit
val open_box : int ‑> unit
val pp_close_box : formatter ‑> unit ‑> unit
val close_box : unit ‑> unit
val pp_open_hbox : formatter ‑> unit ‑> unit
val open_hbox : unit ‑> unit
val pp_open_vbox : formatter ‑> int ‑> unit
val open_vbox : int ‑> unit
val pp_open_hvbox : formatter ‑> int ‑> unit
val open_hvbox : int ‑> unit
val pp_open_hovbox : formatter ‑> int ‑> unit
val open_hovbox : int ‑> unit
val pp_print_string : formatter ‑> string ‑> unit
val print_string : string ‑> unit
val pp_print_as : formatter ‑> int ‑> string ‑> unit
val print_as : int ‑> string ‑> unit
val pp_print_int : formatter ‑> int ‑> unit
val print_int : int ‑> unit
val pp_print_float : formatter ‑> float ‑> unit
val print_float : float ‑> unit
val pp_print_char : formatter ‑> char ‑> unit
val print_char : char ‑> unit
val pp_print_bool : formatter ‑> bool ‑> unit
val print_bool : bool ‑> unit
val pp_print_space : formatter ‑> unit ‑> unit
val print_space : unit ‑> unit
val pp_print_cut : formatter ‑> unit ‑> unit
val print_cut : unit ‑> unit
val pp_print_break : formatter ‑> int ‑> int ‑> unit
val print_break : int ‑> int ‑> unit
val pp_force_newline : formatter ‑> unit ‑> unit
val force_newline : unit ‑> unit
val pp_print_if_newline : formatter ‑> unit ‑> unit
val print_if_newline : unit ‑> unit
val pp_print_flush : formatter ‑> unit ‑> unit
val print_flush : unit ‑> unit
val pp_print_newline : formatter ‑> unit ‑> unit
val print_newline : unit ‑> unit
val pp_set_margin : formatter ‑> int ‑> unit
val set_margin : int ‑> unit
val pp_get_margin : formatter ‑> unit ‑> int
val get_margin : unit ‑> int
val pp_set_max_indent : formatter ‑> int ‑> unit
val set_max_indent : int ‑> unit
val pp_get_max_indent : formatter ‑> unit ‑> int
val get_max_indent : unit ‑> int
val pp_set_max_boxes : formatter ‑> int ‑> unit
val set_max_boxes : int ‑> unit
val pp_get_max_boxes : formatter ‑> unit ‑> int
val get_max_boxes : unit ‑> int
val pp_over_max_boxes : formatter ‑> unit ‑> bool
val over_max_boxes : unit ‑> bool
val pp_open_tbox : formatter ‑> unit ‑> unit
val open_tbox : unit ‑> unit
val pp_close_tbox : formatter ‑> unit ‑> unit
val close_tbox : unit ‑> unit
val pp_set_tab : formatter ‑> unit ‑> unit
val set_tab : unit ‑> unit
val pp_print_tab : formatter ‑> unit ‑> unit
val print_tab : unit ‑> unit
val pp_print_tbreak : formatter ‑> int ‑> int ‑> unit
val print_tbreak : int ‑> int ‑> unit
val pp_set_ellipsis_text : formatter ‑> string ‑> unit
val set_ellipsis_text : string ‑> unit
val pp_get_ellipsis_text : formatter ‑> unit ‑> string
val get_ellipsis_text : unit ‑> string
type tag = string
val pp_open_tag : formatter ‑> string ‑> unit
val open_tag : tag ‑> unit
val pp_close_tag : formatter ‑> unit ‑> unit
val close_tag : unit ‑> unit
val pp_set_tags : formatter ‑> bool ‑> unit
val set_tags : bool ‑> unit
val pp_set_print_tags : formatter ‑> bool ‑> unit
val set_print_tags : bool ‑> unit
val pp_set_mark_tags : formatter ‑> bool ‑> unit
val set_mark_tags : bool ‑> unit
val pp_get_print_tags : formatter ‑> unit ‑> bool
val get_print_tags : unit ‑> bool
val pp_get_mark_tags : formatter ‑> unit ‑> bool
val get_mark_tags : unit ‑> bool
val pp_set_formatter_out_channel : formatter ‑> Pervasives.out_channel ‑> unit
val set_formatter_out_channel : Pervasives.out_channel ‑> unit
val pp_set_formatter_output_functions : formatter ‑> (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> unit
val set_formatter_output_functions : (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> unit
val pp_get_formatter_output_functions : formatter ‑> unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit)
val get_formatter_output_functions : unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit)
type formatter_out_functions = Format.formatter_out_functions = {
out_string : string ‑> int ‑> int ‑> unit;
out_flush : unit ‑> unit;
out_newline : unit ‑> unit;
out_spaces : int ‑> unit;
out_indent : int ‑> unit;
}
val pp_set_formatter_out_functions : formatter ‑> formatter_out_functions ‑> unit
val set_formatter_out_functions : formatter_out_functions ‑> unit
val pp_get_formatter_out_functions : formatter ‑> unit ‑> formatter_out_functions
val get_formatter_out_functions : unit ‑> formatter_out_functions
type formatter_tag_functions = Format.formatter_tag_functions = {
mark_open_tag : tag ‑> string;
mark_close_tag : tag ‑> string;
print_open_tag : tag ‑> unit;
print_close_tag : tag ‑> unit;
}
val pp_set_formatter_tag_functions : formatter ‑> formatter_tag_functions ‑> unit
val set_formatter_tag_functions : formatter_tag_functions ‑> unit
val pp_get_formatter_tag_functions : formatter ‑> unit ‑> formatter_tag_functions
val get_formatter_tag_functions : unit ‑> formatter_tag_functions
val formatter_of_out_channel : Pervasives.out_channel ‑> formatter
val std_formatter : formatter
val err_formatter : formatter
val formatter_of_buffer : Buffer.t ‑> formatter
val stdbuf : Buffer.t
val str_formatter : formatter
val flush_str_formatter : unit ‑> string
val make_formatter : (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> formatter
val formatter_of_out_functions : formatter_out_functions ‑> formatter
type symbolic_output_item = Format.symbolic_output_item =
| Output_flush
| Output_newline
| Output_string of string
| Output_spaces of int
| Output_indent of int
type symbolic_output_buffer = Format.symbolic_output_buffer
val make_symbolic_output_buffer : unit ‑> symbolic_output_buffer
val clear_symbolic_output_buffer : symbolic_output_buffer ‑> unit
val get_symbolic_output_buffer : symbolic_output_buffer ‑> symbolic_output_item list
val flush_symbolic_output_buffer : symbolic_output_buffer ‑> symbolic_output_item list
val add_symbolic_output_item : symbolic_output_buffer ‑> symbolic_output_item ‑> unit
val formatter_of_symbolic_output_buffer : symbolic_output_buffer ‑> formatter
val pp_print_list : ?⁠pp_sep:(formatter ‑> unit ‑> unit) ‑> (formatter ‑> 'a ‑> unit) ‑> formatter ‑> 'a list ‑> unit
val pp_print_text : formatter ‑> string ‑> unit
val fprintf : formatter ‑> ('aformatter, unit) Pervasives.format ‑> 'a
val printf : ('aformatter, unit) Pervasives.format ‑> 'a
val eprintf : ('aformatter, unit) Pervasives.format ‑> 'a
val sprintf : ('a, unit, string) Pervasives.format ‑> 'a
val asprintf : ('aformatter, unit, string) Pervasives.format4 ‑> 'a
val ifprintf : formatter ‑> ('aformatter, unit) Pervasives.format ‑> 'a
val kfprintf : (formatter ‑> 'a) ‑> formatter ‑> ('bformatter, unit, 'a) Pervasives.format4 ‑> 'b
val ikfprintf : (formatter ‑> 'a) ‑> formatter ‑> ('bformatter, unit, 'a) Pervasives.format4 ‑> 'b
val ksprintf : (string ‑> 'a) ‑> ('b, unit, string, 'a) Pervasives.format4 ‑> 'b
val kasprintf : (string ‑> 'a) ‑> ('bformatter, unit, 'a) Pervasives.format4 ‑> 'b
val bprintf : Buffer.t ‑> ('aformatter, unit) Pervasives.format ‑> 'a
val kprintf : (string ‑> 'a) ‑> ('b, unit, string, 'a) Pervasives.format4 ‑> 'b
  • Deprecated Use Format.ksprintf instead.
val set_all_formatter_output_functions : out:(string ‑> int ‑> int ‑> unit) ‑> flush:(unit ‑> unit) ‑> newline:(unit ‑> unit) ‑> spaces:(int ‑> unit) ‑> unit
  • Deprecated Use Format.set_formatter_out_functions instead.
val get_all_formatter_output_functions : unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit) * (unit ‑> unit) * (int ‑> unit)
  • Deprecated Use Format.get_formatter_out_functions instead.
val pp_set_all_formatter_output_functions : formatter ‑> out:(string ‑> int ‑> int ‑> unit) ‑> flush:(unit ‑> unit) ‑> newline:(unit ‑> unit) ‑> spaces:(int ‑> unit) ‑> unit
  • Deprecated Use Format.pp_set_formatter_out_functions instead.
val pp_get_all_formatter_output_functions : formatter ‑> unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit) * (unit ‑> unit) * (int ‑> unit)
  • Deprecated Use Format.pp_get_formatter_out_functions instead.
type t = Format.formatter
type 'a printer = t ‑> 'a ‑> unit

Combinators

val silent : 'a printer

Prints nothing.

val unit : unit printer

Prints "()".

val int : int printer
val string : string printer
val bool : bool printer
val float3 : float printer
val float : float printer
val newline : unit printer

Force newline (see Format.pp_force_newline).

  • Since: 1.2
val substring : (string * int * int) printer

Print the substring (s,i,len), where i is the offset +in s and len the number of bytes in the substring.

  • Raises Invalid_argument: if the triple (s,i,len) does not +describe a proper substring.
  • Since: 1.2
val text : string printer

Print string, but replacing spaces with breaks and newlines +with newline. +See pp_print_text on recent versions of OCaml.

  • Since: 1.2
val char : char printer
  • Since: 0.14
val int32 : int32 printer
  • Since: 0.14
val int64 : int64 printer
  • Since: 0.14
val nativeint : nativeint printer
  • Since: 0.14
val flush : unit printer

Alias to Format.pp_print_flush.

  • Since: 1.2
val string_quoted : string printer

Similar to CCString.print.

  • Since: 0.14
val list : ?⁠sep:unit printer ‑> 'a printer ‑> 'a list printer
val array : ?⁠sep:unit printer ‑> 'a printer ‑> 'a array printer
val arrayi : ?⁠sep:unit printer ‑> (int * 'a) printer ‑> 'a array printer
val seq : ?⁠sep:unit printer ‑> 'a printer ‑> 'a sequence printer
val opt : 'a printer ‑> 'a option printer

opt pp prints options as follows: +

  • Some x will become "some foo" if pp x ---> "foo".
  • None will become "none".

In the tuple printers, the sep argument is only available.

val pair : ?⁠sep:unit printer ‑> 'a printer ‑> 'b printer ‑> ('a * 'b) printer
val triple : ?⁠sep:unit printer ‑> 'a printer ‑> 'b printer ‑> 'c printer ‑> ('a * 'b * 'c) printer
val quad : ?⁠sep:unit printer ‑> 'a printer ‑> 'b printer ‑> 'c printer ‑> 'd printer ‑> ('a * 'b * 'c * 'd) printer
val within : string ‑> string ‑> 'a printer ‑> 'a printer

within a b p wraps p inside the strings a and b. Convenient, +for instances, for brackets, parenthesis, quotes, etc.

  • Since: 0.17
val map : ('a ‑> 'b) ‑> 'b printer ‑> 'a printer
val vbox : ?⁠i:int ‑> 'a printer ‑> 'a printer

Wrap the printer in a vertical box.

  • Parameter i: level of indentation within the box (default 0).
  • Since: 0.16
val hvbox : ?⁠i:int ‑> 'a printer ‑> 'a printer

Wrap the printer in a horizontal/vertical box.

  • Parameter i: level of indentation within the box (default 0).
  • Since: 0.16
val hovbox : ?⁠i:int ‑> 'a printer ‑> 'a printer

Wrap the printer in a horizontal or vertical box.

  • Parameter i: level of indentation within the box (default 0).
  • Since: 0.16
val hbox : 'a printer ‑> 'a printer

Wrap the printer in an horizontal box.

  • Since: 0.16
val return : ('a__'a) Pervasives.format4 ‑> unit printer

return "some_format_string" takes a argument-less format string +and returns a printer actionable by (). +Examples: +

  • return ",@ "
  • return "@{<Red>and then@}@,"
  • return "@[<v>a@ b@]"
  • Since: 1.0
val of_to_string : ('a ‑> string) ‑> 'a printer

of_to_string f converts its input to a string using f, +then prints the string.

  • Since: 1.0
val const : 'a printer ‑> 'a ‑> unit printer

const pp x is a unit printer that uses pp on x.

  • Since: 1.0
val some : 'a printer ‑> 'a option printer

some pp will print options as follows: +

  • Some x is printed using pp on x
  • None is not printed at all
  • Since: 1.0
val lazy_force : 'a printer ‑> 'a lazy_t printer

lazy_force pp out x forces x and prints the result with pp.

  • Since: 2.0
val lazy_or : ?⁠default:unit printer ‑> 'a printer ‑> 'a lazy_t printer

lazy_or ?default pp out x prints default if x is not +evaluated yet, or uses pp otherwise.

  • Since: 2.0

ANSI codes

Use ANSI escape codes https://en.wikipedia.org/wiki/ANSI_escape_code +to put some colors on the terminal.

This uses tags in format strings to specify the style. Current styles +are the following:

Example:

      set_color_default true;;
+
+      Format.printf
+        "what is your @{<White>favorite color@}? @{<blue>blue@}! No, @{<red>red@}! Ahhhhhhh@.";;

status: unstable

val set_color_tag_handling : t ‑> unit

Add functions to support color tags to the given formatter.

  • Since: 0.15
val set_color_default : bool ‑> unit

set_color_default b enables color handling on the standard formatters +(stdout, stderr) if b = true as well as on sprintf formatters; +it disables the color handling if b = false.

val with_color : string ‑> 'a printer ‑> 'a printer

with_color "Blue" pp behaves like the printer pp, but with the given +style.

status: unstable

  • Since: 0.16
val with_colorf : string ‑> t ‑> ('at, unit, unit) Pervasives.format4 ‑> 'a

with_colorf "Blue" out "%s %d" "yolo" 42 will behave like Format.fprintf, +but wrapping the content with the given style.

status: unstable

  • Since: 0.16
val with_color_sf : string ‑> ('at, unit, string) Pervasives.format4 ‑> 'a

with_color_sf "Blue" out "%s %d" "yolo" 42 will behave like +sprintf, but wrapping the content with the given style.

Example: +

      CCFormat.with_color_sf "red" "%a" CCFormat.Dump.(list int) [1;2;3] |> print_endline;;

status: unstable

  • Since: 0.21
val with_color_ksf : f:(string ‑> 'b) ‑> string ‑> ('at, unit, 'b) Pervasives.format4 ‑> 'a

with_color_ksf "Blue" ~f "%s %d" "yolo" 42 will behave like +ksprintf, but wrapping the content with the given style.

Example: +the following with raise Failure with a colored message +

      CCFormat.with_color_ksf "red" ~f:failwith "%a" CCFormat.Dump.(list int) [1;2;3];;
  • Since: 1.2

IO

val output : t ‑> 'a printer ‑> 'a ‑> unit
val to_string : 'a printer ‑> 'a ‑> string
val of_chan : Pervasives.out_channel ‑> t

Alias to Format.formatter_of_out_channel.

  • Since: 1.2
val with_out_chan : Pervasives.out_channel ‑> (t ‑> 'a) ‑> 'a

with_out_chan oc f turns oc into a formatter fmt, and call f fmt. +Behaves like f fmt from then on, but whether the call to f fails +or returns, fmt is flushed before the call terminates.

  • Since: 1.2
val stdout : t
val stderr : t
val tee : t ‑> t ‑> t

tee a b makes a new formatter that writes in both a and b.

  • Since: 1.0
val sprintf : ('at, unit, string) Pervasives.format4 ‑> 'a

Print into a string any format string that would usually be compatible +with fprintf. Like Format.asprintf.

val sprintf_no_color : ('at, unit, string) Pervasives.format4 ‑> 'a

Like sprintf but never prints colors.

  • Since: 0.16
val sprintf_dyn_color : colors:bool ‑> ('at, unit, string) Pervasives.format4 ‑> 'a

Like sprintf but enable/disable colors depending on colors.

Example: +

      (* with colors *)
+      CCFormat.sprintf_dyn_color ~colors:true "@{<Red>%a@}"
+        CCFormat.Dump.(list int) [1;2;3] |> print_endline;;
+
+      (* without colors *)
+      CCFormat.sprintf_dyn_color ~colors:false "@{<Red>%a@}"
+        CCFormat.Dump.(list int) [1;2;3] |> print_endline;;
  • Since: 0.21
val fprintf : t ‑> ('at, unit) Pervasives.format ‑> 'a

Alias to Format.fprintf.

  • Since: 0.14
val fprintf_dyn_color : colors:bool ‑> t ‑> ('at, unit) Pervasives.format ‑> 'a

Like fprintf but enable/disable colors depending on colors.

  • Since: 0.21
val ksprintf : ?⁠margin:int ‑> f:(string ‑> 'b) ‑> ('a, Format.formatter, unit, 'b) Pervasives.format4 ‑> 'a

ksprintf fmt ~f formats using fmt, in a way similar to sprintf, +and then calls f on the resulting string.

  • Parameter margin: set margin (since 2.1)
  • Since: 0.14
val to_file : string ‑> ('at, unit, unit) Pervasives.format4 ‑> 'a

Print to the given file.

Dump

Print structures as OCaml values, so that they can be parsed back +by OCaml (typically, in the toplevel, for debugging).

Example: +

      Format.printf "%a@." CCFormat.Dump.(list int) CCList.(1 -- 200);;
+
+      Format.printf "%a@." CCFormat.Dump.(array (list (pair int bool)))
+        [| [1, true; 2, false]; []; [42, false] |];;
module Dump : sig ... end
\ No newline at end of file diff --git a/2.3/containers/CCFun/.jbuilder-keep b/2.3/containers/CCFun/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCFun/Monad/argument-1-X/index.html b/2.3/containers/CCFun/Monad/argument-1-X/index.html new file mode 100644 index 00000000..2aecaebc --- /dev/null +++ b/2.3/containers/CCFun/Monad/argument-1-X/index.html @@ -0,0 +1,2 @@ + +1-X (containers.CCFun.Monad.1-X)

Parameter CCFun.Monad.1-X

type t
\ No newline at end of file diff --git a/2.3/containers/CCFun/Monad/index.html b/2.3/containers/CCFun/Monad/index.html new file mode 100644 index 00000000..67350d69 --- /dev/null +++ b/2.3/containers/CCFun/Monad/index.html @@ -0,0 +1,2 @@ + +Monad (containers.CCFun.Monad)

Module CCFun.Monad

Parameters

X : sig ... end

Signature

type 'a t = X.t ‑> 'a
val return : 'a ‑> 'a t

Monadic return.

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind.

\ No newline at end of file diff --git a/2.3/containers/CCFun/index.html b/2.3/containers/CCFun/index.html new file mode 100644 index 00000000..744a839b --- /dev/null +++ b/2.3/containers/CCFun/index.html @@ -0,0 +1,18 @@ + +CCFun (containers.CCFun)

Module CCFun

Basic Functions

val (|>) : 'a ‑> ('a ‑> 'b) ‑> 'b

A 'pipe' operator. x |> f is the same as f x.

val compose : ('a ‑> 'b) ‑> ('b ‑> 'c) ‑> 'a ‑> 'c

Composition. compose f g x is g (f x).

val compose_binop : ('a ‑> 'b) ‑> ('b ‑> 'b ‑> 'c) ‑> 'a ‑> 'a ‑> 'c

compose_binop f g is fun x y -> g (f x) (f y). +Example (partial order): +List.sort (compose_binop fst CCInt.compare) [1, true; 2, false; 1, false].

  • Since: 0.6
val (%>) : ('a ‑> 'b) ‑> ('b ‑> 'c) ‑> 'a ‑> 'c

Alias to compose.

val (@@) : ('a ‑> 'b) ‑> 'a ‑> 'b

f @@ x is the same as f x, but right-associative.

  • Since: 0.5
val id : 'a ‑> 'a

Identity function.

val const : 'a ‑> 'b ‑> 'a

Produce a function that just returns its first argument. +const x y = x for any y.

val flip : ('a ‑> 'b ‑> 'c) ‑> 'b ‑> 'a ‑> 'c

Reverse the order of arguments for a binary function.

val curry : (('a * 'b) ‑> 'c) ‑> 'a ‑> 'b ‑> 'c

Convert a function which accepts a pair of arguments into a function which accepts two arguments. +curry f x y is f (x,y).

val uncurry : ('a ‑> 'b ‑> 'c) ‑> ('a * 'b) ‑> 'c

Convert a function which accepts a two arguments into a function which accepts a pair of arguments. +uncurry f (x,y) is f x y.

val tap : ('a ‑> _) ‑> 'a ‑> 'a

tap f x evaluates f x, discards it, then returns x. Useful +in a pipeline, for instance: +

CCArray.(1 -- 10)
+      |> tap CCArray.shuffle
+      |> tap @@ CCArray.sort Pervasives.compare
val (%) : ('b ‑> 'c) ‑> ('a ‑> 'b) ‑> 'a ‑> 'c

Mathematical composition. (%) f g x is f (g x).

val lexicographic : ('a ‑> 'a ‑> int) ‑> ('a ‑> 'a ‑> int) ‑> 'a ‑> 'a ‑> int

Lexicographic combination of comparison functions.

val finally : h:(unit ‑> _) ‑> f:(unit ‑> 'a) ‑> 'a

finally h f calls f () and returns its result. If it raises, the +same exception is raised; in any case, h () is called after +f () terminates.

val finally1 : h:(unit ‑> _) ‑> ('a ‑> 'b) ‑> 'a ‑> 'b

finally1 ~h f x is the same as f x, but after the computation, +h () is called whether f x rose an exception or not.

  • Since: 0.16
val finally2 : h:(unit ‑> _) ‑> ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> 'c

finally2 ~h f x y is the same as f x y, but after the computation, +h () is called whether f x y rose an exception or not.

  • Since: 0.16
val opaque_identity : 'a ‑> 'a

opaque_identity x is like x, but prevents Flambda from using x's +definition for optimizing it. (flambda is an optimization/inlining pass +in OCaml >= 4.03).

  • Since: 0.18
val iterate : int ‑> ('a ‑> 'a) ‑> 'a ‑> 'a

iterate n f is f iterated n times. That is to say, iterate 0 f x is +x, iterate 1 f x is f x, iterate 2 f x is f (f x), etc.

  • Since: 2.1

Monad

Functions with a fixed domain are monads in their codomain.

module Monad : functor (X : sig ... end) -> sig ... end
\ No newline at end of file diff --git a/2.3/containers/CCFun_vec/.jbuilder-keep b/2.3/containers/CCFun_vec/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCFun_vec/index.html b/2.3/containers/CCFun_vec/index.html new file mode 100644 index 00000000..3e6c6fbf --- /dev/null +++ b/2.3/containers/CCFun_vec/index.html @@ -0,0 +1,3 @@ + +CCFun_vec (containers.CCFun_vec)

Module CCFun_vec

Functional Vectors

Tree with a large branching factor for logarithmic operations with +a low multiplicative factor.

status: experimental. DO NOT USE (yet)

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a ktree = unit ‑> [ `Nil | `Node of 'a * 'a ktree list ]

Signature

type 'a t
val empty : 'a t
val is_empty : _ t ‑> bool
val return : 'a ‑> 'a t
val length : _ t ‑> int
val push : 'a ‑> 'a t ‑> 'a t

Add element at the end.

val get : int ‑> 'a t ‑> 'a option
val get_exn : int ‑> 'a t ‑> 'a
  • Raises Not_found: if key not present.
val pop_exn : 'a t ‑> 'a * 'a t

Pop last element.

val iter : f:('a ‑> unit) ‑> 'a t ‑> unit
val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Iterate on elements with their index, in increasing order.

val iteri_rev : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Iterate on elements with their index, but starting from the end.

val fold : f:('b ‑> 'a ‑> 'b) ‑> x:'b ‑> 'a t ‑> 'b
val foldi : f:('b ‑> int ‑> 'a ‑> 'b) ‑> x:'b ‑> 'a t ‑> 'b
val append : 'a t ‑> 'a t ‑> 'a t
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t
val choose : 'a t ‑> 'a option
Conversions
val to_list : 'a t ‑> 'a list
val of_list : 'a list ‑> 'a t
val add_list : 'a t ‑> 'a list ‑> 'a t
val add_seq : 'a t ‑> 'a sequence ‑> 'a t
val of_seq : 'a sequence ‑> 'a t
val to_seq : 'a t ‑> 'a sequence
val add_gen : 'a t ‑> 'a gen ‑> 'a t
val of_gen : 'a gen ‑> 'a t
val to_gen : 'a t ‑> 'a gen
IO
val pp : 'a printer ‑> 'a t printer
\ No newline at end of file diff --git a/2.3/containers/CCGraph/.jbuilder-keep b/2.3/containers/CCGraph/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCGraph/Dot/index.html b/2.3/containers/CCGraph/Dot/index.html new file mode 100644 index 00000000..af5f3b7f --- /dev/null +++ b/2.3/containers/CCGraph/Dot/index.html @@ -0,0 +1,2 @@ + +Dot (containers.CCGraph.Dot)

Module CCGraph.Dot

type attribute = [
| `Color of string
| `Shape of string
| `Weight of int
| `Style of string
| `Label of string
| `Other of string * string
]

Dot attribute

type vertex_state

Hidden state associated to a vertex

val pp : tbl:('vvertex_statetable ‑> eq:('v ‑> 'v ‑> bool) ‑> ?⁠attrs_v:('v ‑> attribute list) ‑> ?⁠attrs_e:('e ‑> attribute list) ‑> ?⁠name:string ‑> graph:('v'et ‑> Format.formatter ‑> 'v ‑> unit

Print the graph, starting from given vertex, on the formatter.

  • Parameter attrs_v: attributes for vertices.
  • Parameter attrs_e: attributes for edges.
  • Parameter name: name of the graph.
val pp_seq : tbl:('vvertex_statetable ‑> eq:('v ‑> 'v ‑> bool) ‑> ?⁠attrs_v:('v ‑> attribute list) ‑> ?⁠attrs_e:('e ‑> attribute list) ‑> ?⁠name:string ‑> graph:('v'et ‑> Format.formatter ‑> 'v sequence ‑> unit
val with_out : string ‑> (Format.formatter ‑> 'a) ‑> 'a

Shortcut to open a file and write to it.

\ No newline at end of file diff --git a/2.3/containers/CCGraph/Lazy_tree/index.html b/2.3/containers/CCGraph/Lazy_tree/index.html new file mode 100644 index 00000000..10768f5e --- /dev/null +++ b/2.3/containers/CCGraph/Lazy_tree/index.html @@ -0,0 +1,2 @@ + +Lazy_tree (containers.CCGraph.Lazy_tree)

Module CCGraph.Lazy_tree

type ('v, 'e) t = {
vertex : 'v;
children : ('e * ('v'et) list Lazy.t;
}
val map_v : ('a ‑> 'b) ‑> ('a'et ‑> ('b'et
val fold_v : ('acc ‑> 'v ‑> 'acc) ‑> 'acc ‑> ('v_t ‑> 'acc
\ No newline at end of file diff --git a/2.3/containers/CCGraph/Map/index.html b/2.3/containers/CCGraph/Map/index.html new file mode 100644 index 00000000..0919ac63 --- /dev/null +++ b/2.3/containers/CCGraph/Map/index.html @@ -0,0 +1,4 @@ + +Map (containers.CCGraph.Map)

Module CCGraph.Map

Parameters

O : Map.OrderedType

Signature

type vertex = O.t
type 'a t
val as_graph : 'a t ‑> (vertex'agraph

Graph view of the map.

val empty : 'a t
val add_edge : vertex ‑> 'a ‑> vertex ‑> 'a t ‑> 'a t
val remove_edge : vertex ‑> vertex ‑> 'a t ‑> 'a t
val add : vertex ‑> 'a t ‑> 'a t

Add a vertex, possibly with no outgoing edge.

val remove : vertex ‑> 'a t ‑> 'a t

Remove the vertex and all its outgoing edges. +Edges that point to the vertex are NOT removed, they must be +manually removed with remove_edge.

val union : 'a t ‑> 'a t ‑> 'a t
val vertices : _ t ‑> vertex sequence
val vertices_l : _ t ‑> vertex list
val of_list : (vertex * 'a * vertex) list ‑> 'a t
val add_list : (vertex * 'a * vertex) list ‑> 'a t ‑> 'a t
val to_list : 'a t ‑> (vertex * 'a * vertex) list
val of_seq : (vertex * 'a * vertex) sequence ‑> 'a t
val add_seq : (vertex * 'a * vertex) sequence ‑> 'a t ‑> 'a t
val to_seq : 'a t ‑> (vertex * 'a * vertex) sequence
\ No newline at end of file diff --git a/2.3/containers/CCGraph/Seq/index.html b/2.3/containers/CCGraph/Seq/index.html new file mode 100644 index 00000000..89904bd5 --- /dev/null +++ b/2.3/containers/CCGraph/Seq/index.html @@ -0,0 +1,2 @@ + +Seq (containers.CCGraph.Seq)

Module CCGraph.Seq

type 'a t = 'a sequence
val return : 'a ‑> 'a sequence
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t
val filter_map : ('a ‑> 'b option) ‑> 'a t ‑> 'b t
val iter : ('a ‑> unit) ‑> 'a t ‑> unit
val fold : ('b ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b
val to_list : 'a t ‑> 'a list
\ No newline at end of file diff --git a/2.3/containers/CCGraph/Traverse/Event/index.html b/2.3/containers/CCGraph/Traverse/Event/index.html new file mode 100644 index 00000000..8d30fe88 --- /dev/null +++ b/2.3/containers/CCGraph/Traverse/Event/index.html @@ -0,0 +1,2 @@ + +Event (containers.CCGraph.Traverse.Event)

Module CCGraph.Traverse.Event

More detailed interface

type edge_kind = [
| `Forward
| `Back
| `Cross
]
type ('v, 'e) t = [
| `Enter of 'v * int * ('v'epath
| `Exit of 'v
| `Edge of 'v * 'e * 'v * edge_kind
]

A traversal is a sequence of such events

val get_vertex : ('v'et ‑> ('v * [ `Enter | `Exit ]) option
val get_enter : ('v'et ‑> 'v option
val get_exit : ('v'et ‑> 'v option
val get_edge : ('v'et ‑> ('v * 'e * 'v) option
val get_edge_kind : ('v'et ‑> ('v * 'e * 'v * edge_kind) option
val dfs : tbl:'v set ‑> eq:('v ‑> 'v ‑> bool) ‑> graph:('v'egraph ‑> 'v sequence ‑> ('v'et sequence_once

Full version of DFS.

  • Parameter eq: equality predicate on vertices.
val dfs_tag : eq:('v ‑> 'v ‑> bool) ‑> tags:'v tag_set ‑> graph:('v'egraph ‑> 'v sequence ‑> ('v'et sequence_once

Full version of DFS using integer tags.

  • Parameter eq: equality predicate on vertices.
\ No newline at end of file diff --git a/2.3/containers/CCGraph/Traverse/index.html b/2.3/containers/CCGraph/Traverse/index.html new file mode 100644 index 00000000..3a12b109 --- /dev/null +++ b/2.3/containers/CCGraph/Traverse/index.html @@ -0,0 +1,7 @@ + +Traverse (containers.CCGraph.Traverse)

Module CCGraph.Traverse

type ('v, 'e) path = ('v * 'e * 'v) list
val generic : tbl:'v set ‑> bag:'v bag ‑> graph:('v'et ‑> 'v sequence ‑> 'v sequence_once

Traversal of the given graph, starting from a sequence +of vertices, using the given bag to choose the next vertex to +explore. Each vertex is visited at most once.

val generic_tag : tags:'v tag_set ‑> bag:'v bag ‑> graph:('v'et ‑> 'v sequence ‑> 'v sequence_once

One-shot traversal of the graph using a tag set and the given bag.

val dfs : tbl:'v set ‑> graph:('v'et ‑> 'v sequence ‑> 'v sequence_once
val dfs_tag : tags:'v tag_set ‑> graph:('v'et ‑> 'v sequence ‑> 'v sequence_once
val bfs : tbl:'v set ‑> graph:('v'et ‑> 'v sequence ‑> 'v sequence_once
val bfs_tag : tags:'v tag_set ‑> graph:('v'et ‑> 'v sequence ‑> 'v sequence_once
val dijkstra : tbl:'v set ‑> ?⁠dist:('e ‑> int) ‑> graph:('v'et ‑> 'v sequence ‑> ('v * int * ('v'epath) sequence_once

Dijkstra algorithm, traverses a graph in increasing distance order. +Yields each vertex paired with its distance to the set of initial vertices +(the smallest distance needed to reach the node from the initial vertices).

  • Parameter dist: distance from origin of the edge to destination, +must be strictly positive. Default is 1 for every edge.
val dijkstra_tag : ?⁠dist:('e ‑> int) ‑> tags:'v tag_set ‑> graph:('v'et ‑> 'v sequence ‑> ('v * int * ('v'epath) sequence_once
module Event : sig ... end

More detailed interface

\ No newline at end of file diff --git a/2.3/containers/CCGraph/index.html b/2.3/containers/CCGraph/index.html new file mode 100644 index 00000000..b0e432d6 --- /dev/null +++ b/2.3/containers/CCGraph/index.html @@ -0,0 +1,36 @@ + +CCGraph (containers.CCGraph)

Module CCGraph

Simple Graph Interface

A collections of algorithms on (mostly read-only) graph structures. +The user provides her own graph structure as a ('v, 'e) CCGraph.t, +where 'v is the type of vertices and 'e the type of edges +(for instance, 'e = ('v * 'v) is perfectly fine in many cases).

Such a ('v, 'e) CCGraph.t structure is a record containing +three functions: two relate edges to their origin and destination, +and one maps vertices to their outgoing edges. +This abstract notion of graph makes it possible to run the algorithms +on any user-specific type that happens to have a graph structure.

Many graph algorithms here take a sequence of vertices as input. +If the user only has a single vertex (e.g., for a topological sort +from a given vertex), she can use Seq.return x to build a sequence +of one element.

status: unstable

Sequence Helpers

type 'a sequence = ('a ‑> unit) ‑> unit

A sequence of items of type 'a, possibly infinite

type 'a sequence_once = 'a sequence

Sequence that should be used only once

exception Sequence_once

Raised when a sequence meant to be used once is used several times.

module Seq : sig ... end

Interfaces for graphs

This interface is designed for oriented graphs with labels on edges

type ('v, 'e) t = 'v ‑> ('e * 'v) sequence

Directed graph with vertices of type 'v and edges labeled with e'

type ('v, 'e) graph = ('v'et
val make : ('v ‑> ('e * 'v) sequence) ‑> ('v'et

Make a graph by providing the children function.

type 'v tag_set = {
get_tag : 'v ‑> bool;
set_tag : 'v ‑> unit;

(** Set tag for the given element *)

}

Tags

Mutable tags from values of type 'v to tags of type bool

type ('k, 'a) table = {
mem : 'k ‑> bool;
find : 'k ‑> 'a;

(**

  • Raises Not_found: if element not added before

*)

add : 'k ‑> 'a ‑> unit;

(** Erases previous binding *)

}

Table

Mutable table with keys 'k and values 'a

type 'a set = ('a, unit) table

Mutable set

val mk_table : eq:('k ‑> 'k ‑> bool) ‑> ?⁠hash:('k ‑> int) ‑> int ‑> ('k'atable

Default implementation for table: a Hashtbl.t.

val mk_map : cmp:('k ‑> 'k ‑> int) ‑> unit ‑> ('k'atable

Use a Map.S underneath.

Bags of vertices

type 'a bag = {
push : 'a ‑> unit;
is_empty : unit ‑> bool;
pop : unit ‑> 'a;

(** raises some exception is empty *)

}

Bag of elements of type 'a

val mk_queue : unit ‑> 'a bag
val mk_stack : unit ‑> 'a bag
val mk_heap : leq:('a ‑> 'a ‑> bool) ‑> 'a bag

mk_heap ~leq makes a priority queue where leq x y = true means that +x is smaller than y and should be prioritary.

Traversals

module Traverse : sig ... end

Cycles

val is_dag : tbl:'v set ‑> eq:('v ‑> 'v ‑> bool) ‑> graph:('v_t ‑> 'v sequence ‑> bool

is_dag ~graph vs returns true if the subset of graph reachable +from vs is acyclic.

  • Since: 0.18

Topological Sort

exception Has_cycle
val topo_sort : eq:('v ‑> 'v ‑> bool) ‑> ?⁠rev:bool ‑> tbl:'v set ‑> graph:('v'et ‑> 'v sequence ‑> 'v list

topo_sort ~graph seq returns a list of vertices l where each +element of l is reachable from seq. +The list is sorted in a way such that if v -> v' in the graph, then +v comes before v' in the list (i.e. has a smaller index). +Basically v -> v' means that v is smaller than v'. +See wikipedia.

  • Parameter eq: equality predicate on vertices (default (=)).
  • Parameter rev: if true, the dependency relation is inverted (v -> v' means +v' occurs before v).
  • Raises Has_cycle: if the graph is not a DAG.
val topo_sort_tag : eq:('v ‑> 'v ‑> bool) ‑> ?⁠rev:bool ‑> tags:'v tag_set ‑> graph:('v'et ‑> 'v sequence ‑> 'v list

Same as topo_sort but uses an explicit tag set.

Lazy Spanning Tree

module Lazy_tree : sig ... end
val spanning_tree : tbl:'v set ‑> graph:('v'et ‑> 'v ‑> ('v'eLazy_tree.t

spanning_tree ~graph v computes a lazy spanning tree that has v +as a root. The table tbl is used for the memoization part.

val spanning_tree_tag : tags:'v tag_set ‑> graph:('v'et ‑> 'v ‑> ('v'eLazy_tree.t

Strongly Connected Components

type 'v scc_state

Hidden state for scc.

val scc : tbl:('v'v scc_statetable ‑> graph:('v'et ‑> 'v sequence ‑> 'v list sequence_once

Strongly connected components reachable from the given vertices. +Each component is a list of vertices that are all mutually reachable +in the graph. +The components are explored in a topological order (if C1 and C2 are +components, and C1 points to C2, then C2 will be yielded before C1). +Uses Tarjan's algorithm.

  • Parameter tbl: table used to map nodes to some hidden state.
  • Raises Sequence_once: if the result is iterated on more than once.

Pretty printing in the DOT (graphviz) format

Example (print divisors from 42):

      let open CCGraph in
+      let open Dot in
+      with_out "/tmp/truc.dot"
+        (fun out ->
+           pp ~attrs_v:(fun i -> [`Label (string_of_int i)]) ~graph:divisors_graph out 42
+        )
module Dot : sig ... end

Mutable Graph

type ('v, 'e) mut_graph = {
graph : ('v'et;
add_edge : 'v ‑> 'e ‑> 'v ‑> unit;
remove : 'v ‑> unit;
}
val mk_mut_tbl : eq:('v ‑> 'v ‑> bool) ‑> ?⁠hash:('v ‑> int) ‑> int ‑> ('v'amut_graph

Make a new mutable graph from a Hashtbl. Edges are labelled with type 'a.

Immutable Graph

A classic implementation of a graph structure on totally ordered vertices, +with unlabelled edges. The graph allows to add and remove edges and vertices, +and to iterate on edges and vertices.

module type MAP : sig ... end
module Map : functor (O : Map.OrderedType) -> MAP with type vertex = O.t

Misc

val of_list : eq:('v ‑> 'v ‑> bool) ‑> ('v * 'v) list ‑> ('v, unit) t

of_list l makes a graph from a list of pairs of vertices. +Each pair (a,b) is an edge from a to b.

  • Parameter eq: equality used to compare vertices.
val of_hashtbl : ('v'v list) Hashtbl.t ‑> ('v, unit) t

of_hashtbl tbl makes a graph from a hashtable that maps vertices +to lists of children.

val of_fun : ('v ‑> 'v list) ‑> ('v, unit) t

of_fun f makes a graph out of a function that maps a vertex to +the list of its children. The function is assumed to be deterministic.

val divisors_graph : (int, unit) t

n points to all its strict divisors.

\ No newline at end of file diff --git a/2.3/containers/CCGraph/module-type-MAP/index.html b/2.3/containers/CCGraph/module-type-MAP/index.html new file mode 100644 index 00000000..c2a9119f --- /dev/null +++ b/2.3/containers/CCGraph/module-type-MAP/index.html @@ -0,0 +1,4 @@ + +MAP (containers.CCGraph.MAP)

Module type CCGraph.MAP

type vertex
type 'a t
val as_graph : 'a t ‑> (vertex'agraph

Graph view of the map.

val empty : 'a t
val add_edge : vertex ‑> 'a ‑> vertex ‑> 'a t ‑> 'a t
val remove_edge : vertex ‑> vertex ‑> 'a t ‑> 'a t
val add : vertex ‑> 'a t ‑> 'a t

Add a vertex, possibly with no outgoing edge.

val remove : vertex ‑> 'a t ‑> 'a t

Remove the vertex and all its outgoing edges. +Edges that point to the vertex are NOT removed, they must be +manually removed with remove_edge.

val union : 'a t ‑> 'a t ‑> 'a t
val vertices : _ t ‑> vertex sequence
val vertices_l : _ t ‑> vertex list
val of_list : (vertex * 'a * vertex) list ‑> 'a t
val add_list : (vertex * 'a * vertex) list ‑> 'a t ‑> 'a t
val to_list : 'a t ‑> (vertex * 'a * vertex) list
val of_seq : (vertex * 'a * vertex) sequence ‑> 'a t
val add_seq : (vertex * 'a * vertex) sequence ‑> 'a t ‑> 'a t
val to_seq : 'a t ‑> (vertex * 'a * vertex) sequence
\ No newline at end of file diff --git a/2.3/containers/CCHash/.jbuilder-keep b/2.3/containers/CCHash/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCHash/index.html b/2.3/containers/CCHash/index.html new file mode 100644 index 00000000..149af87c --- /dev/null +++ b/2.3/containers/CCHash/index.html @@ -0,0 +1,8 @@ + +CCHash (containers.CCHash)

Module CCHash

Hash combinators

Definitions

type hash = int

A hash value is a positive integer.

type 'a t = 'a ‑> hash

A hash function for values of type 'a.

val const : hash ‑> _ t

const h hashes any value into h. Use with caution!.

val const0 : _ t

Always return 0. Useful for ignoring elements. +Example: Hash.(pair string const0) will map pairs ("a", 1) +and ("a", 2) to the same hash, but not the same as ("b", 1).

  • Since: 1.5
val int : int t
val bool : bool t
val char : char t
val int32 : int32 t
val int64 : int64 t
val nativeint : nativeint t
val slice : string ‑> int ‑> int t

slice s i len state hashes the slice i, ... i+len-1 of s +into state.

val string : string t
val list : 'a t ‑> 'a list t
val array : 'a t ‑> 'a array t
val opt : 'a t ‑> 'a option t
val pair : 'a t ‑> 'b t ‑> ('a * 'b) t
val triple : 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t
val quad : 'a t ‑> 'b t ‑> 'c t ‑> 'd t ‑> ('a * 'b * 'c * 'd) t
val if_ : bool ‑> 'a t ‑> 'a t ‑> 'a t

Decide which hash function to use depending on the boolean.

val poly : 'a t

The regular polymorphic hash function. +poly x is Hashtbl.hash x.

val list_comm : 'a t ‑> 'a list t

Commutative version of list. Lists that are equal up to permutation +will have the same hash.

  • Since: 1.0
val array_comm : 'a t ‑> 'a array t

Commutative version of array. Arrays that are equal up to permutation +will have the same hash.

  • Since: 1.0

Base hash combinators

val combine : 'a t ‑> hash ‑> 'a ‑> hash
val combine2 : hash ‑> hash ‑> hash
val combine3 : hash ‑> hash ‑> hash ‑> hash
val combine4 : hash ‑> hash ‑> hash ‑> hash ‑> hash
val combine5 : hash ‑> hash ‑> hash ‑> hash ‑> hash ‑> hash
  • Since: 2.1
val combine6 : hash ‑> hash ‑> hash ‑> hash ‑> hash ‑> hash ‑> hash
  • Since: 2.1

Iterators

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
val seq : 'a t ‑> 'a sequence t
val gen : 'a t ‑> 'a gen t
val klist : 'a t ‑> 'a klist t
\ No newline at end of file diff --git a/2.3/containers/CCHashSet/.jbuilder-keep b/2.3/containers/CCHashSet/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCHashSet/Make/argument-1-E/index.html b/2.3/containers/CCHashSet/Make/argument-1-E/index.html new file mode 100644 index 00000000..112db706 --- /dev/null +++ b/2.3/containers/CCHashSet/Make/argument-1-E/index.html @@ -0,0 +1,2 @@ + +1-E (containers.CCHashSet.Make.1-E)

Parameter CCHashSet.Make.1-E

type t
val equal : t ‑> t ‑> bool
val hash : t ‑> int

Positive value

\ No newline at end of file diff --git a/2.3/containers/CCHashSet/Make/index.html b/2.3/containers/CCHashSet/Make/index.html new file mode 100644 index 00000000..db8d4e64 --- /dev/null +++ b/2.3/containers/CCHashSet/Make/index.html @@ -0,0 +1,3 @@ + +Make (containers.CCHashSet.Make)

Module CCHashSet.Make

Parameters

Signature

type t
type elt = E.t
val create : int ‑> t

create n makes a new set with the given capacity n.

val singleton : elt ‑> t

singleton x is the singleton {x}.

val clear : t ‑> unit

clear s removes all elements from s.

val copy : t ‑> t

Fresh copy.

val copy_into : into:t ‑> t ‑> unit

copy_into ~into s copies all elements of s into into.

val insert : t ‑> elt ‑> unit

insert s x adds x into s.

val remove : t ‑> elt ‑> unit

Remove the element, if it were in there.

val cardinal : t ‑> int

cardinal s returns the number of elements in s.

val mem : t ‑> elt ‑> bool

mem s x returns true iff x is in s.

val find_exn : t ‑> elt ‑> elt

find_exn s x returns y if x and y are equal, and mem s y.

  • Raises Not_found: if x not in s.
val find : t ‑> elt ‑> elt option

Safe version of find_exn.

val inter : t ‑> t ‑> t

inter a b returns a ∩ b.

val inter_mut : into:t ‑> t ‑> unit

inter_mut ~into a changes into into a ∩ into.

val union : t ‑> t ‑> t

union a b returns a ∪ b.

val union_mut : into:t ‑> t ‑> unit

union_mut ~into a changes into into a ∪ into.

val diff : t ‑> t ‑> t

diff a b returns a - b.

val subset : t ‑> t ‑> bool

subset a b returns true if all elements of a are in b.

val equal : t ‑> t ‑> bool

equal a b is extensional equality (a and b have the same elements).

val for_all : (elt ‑> bool) ‑> t ‑> bool
val exists : (elt ‑> bool) ‑> t ‑> bool
val iter : (elt ‑> unit) ‑> t ‑> unit

Iterate on values.

val fold : ('a ‑> elt ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on values.

val elements : t ‑> elt list

List of elements.

val of_list : elt list ‑> t
val to_seq : t ‑> elt sequence
val of_seq : elt sequence ‑> t
val add_seq : t ‑> elt sequence ‑> unit
val pp : ?⁠sep:string ‑> elt printer ‑> t printer

pp pp_elt returns a set printer, given a printer for +individual elements.

\ No newline at end of file diff --git a/2.3/containers/CCHashSet/index.html b/2.3/containers/CCHashSet/index.html new file mode 100644 index 00000000..0a6d0524 --- /dev/null +++ b/2.3/containers/CCHashSet/index.html @@ -0,0 +1,2 @@ + +CCHashSet (containers.CCHashSet)

Module CCHashSet

Mutable Set

status: unstable

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a printer = Format.formatter ‑> 'a ‑> unit
module type S : sig ... end
module type ELEMENT : sig ... end
module Make : functor (E : ELEMENT) -> S with type elt = E.t
\ No newline at end of file diff --git a/2.3/containers/CCHashSet/module-type-ELEMENT/index.html b/2.3/containers/CCHashSet/module-type-ELEMENT/index.html new file mode 100644 index 00000000..06a0c3c9 --- /dev/null +++ b/2.3/containers/CCHashSet/module-type-ELEMENT/index.html @@ -0,0 +1,2 @@ + +ELEMENT (containers.CCHashSet.ELEMENT)

Module type CCHashSet.ELEMENT

type t
val equal : t ‑> t ‑> bool
val hash : t ‑> int

Positive value

\ No newline at end of file diff --git a/2.3/containers/CCHashSet/module-type-S/index.html b/2.3/containers/CCHashSet/module-type-S/index.html new file mode 100644 index 00000000..7c9e826c --- /dev/null +++ b/2.3/containers/CCHashSet/module-type-S/index.html @@ -0,0 +1,3 @@ + +S (containers.CCHashSet.S)

Module type CCHashSet.S

type t
type elt
val create : int ‑> t

create n makes a new set with the given capacity n.

val singleton : elt ‑> t

singleton x is the singleton {x}.

val clear : t ‑> unit

clear s removes all elements from s.

val copy : t ‑> t

Fresh copy.

val copy_into : into:t ‑> t ‑> unit

copy_into ~into s copies all elements of s into into.

val insert : t ‑> elt ‑> unit

insert s x adds x into s.

val remove : t ‑> elt ‑> unit

Remove the element, if it were in there.

val cardinal : t ‑> int

cardinal s returns the number of elements in s.

val mem : t ‑> elt ‑> bool

mem s x returns true iff x is in s.

val find_exn : t ‑> elt ‑> elt

find_exn s x returns y if x and y are equal, and mem s y.

  • Raises Not_found: if x not in s.
val find : t ‑> elt ‑> elt option

Safe version of find_exn.

val inter : t ‑> t ‑> t

inter a b returns a ∩ b.

val inter_mut : into:t ‑> t ‑> unit

inter_mut ~into a changes into into a ∩ into.

val union : t ‑> t ‑> t

union a b returns a ∪ b.

val union_mut : into:t ‑> t ‑> unit

union_mut ~into a changes into into a ∪ into.

val diff : t ‑> t ‑> t

diff a b returns a - b.

val subset : t ‑> t ‑> bool

subset a b returns true if all elements of a are in b.

val equal : t ‑> t ‑> bool

equal a b is extensional equality (a and b have the same elements).

val for_all : (elt ‑> bool) ‑> t ‑> bool
val exists : (elt ‑> bool) ‑> t ‑> bool
val iter : (elt ‑> unit) ‑> t ‑> unit

Iterate on values.

val fold : ('a ‑> elt ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on values.

val elements : t ‑> elt list

List of elements.

val of_list : elt list ‑> t
val to_seq : t ‑> elt sequence
val of_seq : elt sequence ‑> t
val add_seq : t ‑> elt sequence ‑> unit
val pp : ?⁠sep:string ‑> elt printer ‑> t printer

pp pp_elt returns a set printer, given a printer for +individual elements.

\ No newline at end of file diff --git a/2.3/containers/CCHashTrie/.jbuilder-keep b/2.3/containers/CCHashTrie/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCHashTrie/Make/argument-1-K/index.html b/2.3/containers/CCHashTrie/Make/argument-1-K/index.html new file mode 100644 index 00000000..2cc3ad5b --- /dev/null +++ b/2.3/containers/CCHashTrie/Make/argument-1-K/index.html @@ -0,0 +1,2 @@ + +1-K (containers.CCHashTrie.Make.1-K)

Parameter CCHashTrie.Make.1-K

type t
val equal : t ‑> t ‑> bool
val hash : t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCHashTrie/Make/index.html b/2.3/containers/CCHashTrie/Make/index.html new file mode 100644 index 00000000..0b7736de --- /dev/null +++ b/2.3/containers/CCHashTrie/Make/index.html @@ -0,0 +1,9 @@ + +Make (containers.CCHashTrie.Make)

Module CCHashTrie.Make

Functors

Parameters

K : KEY

Signature

type key = K.t
type 'a t
val empty : 'a t
val is_empty : _ t ‑> bool
val singleton : key ‑> 'a ‑> 'a t
val add : key ‑> 'a ‑> 'a t ‑> 'a t
val mem : key ‑> _ t ‑> bool
val get : key ‑> 'a t ‑> 'a option
val get_exn : key ‑> 'a t ‑> 'a
  • Raises Not_found: if key not present.
val remove : key ‑> 'a t ‑> 'a t

Remove the key, if present.

val update : key ‑> f:('a option ‑> 'a option) ‑> 'a t ‑> 'a t

update k ~f m calls f (Some v) if get k m = Some v, f None +otherwise. Then, if f returns Some v' it binds k to v', +if f returns None it removes k.

val add_mut : id:Transient.t ‑> key ‑> 'a ‑> 'a t ‑> 'a t

add_mut ~id k v m behaves like add k v m, except it will mutate +in place whenever possible. Changes done with an id might affect all +versions of the structure obtained with the same id (but not +other versions).

  • Raises Transient.Frozen: if id is frozen.
val remove_mut : id:Transient.t ‑> key ‑> 'a t ‑> 'a t

Same as remove, but modifies in place whenever possible.

  • Raises Transient.Frozen: if id is frozen.
val update_mut : id:Transient.t ‑> key ‑> f:('a option ‑> 'a option) ‑> 'a t ‑> 'a t

Same as update but with mutability.

  • Raises Transient.Frozen: if id is frozen.
val cardinal : _ t ‑> int
val choose : 'a t ‑> (key * 'a) option
val choose_exn : 'a t ‑> key * 'a
  • Raises Not_found: if not pair was found.
val iter : f:(key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val fold : f:('b ‑> key ‑> 'a ‑> 'b) ‑> x:'b ‑> 'a t ‑> 'b
Conversions
val to_list : 'a t ‑> (key * 'a) list
val add_list : 'a t ‑> (key * 'a) list ‑> 'a t
val add_list_mut : id:Transient.t ‑> 'a t ‑> (key * 'a) list ‑> 'a t
  • Raises Frozen: if the ID is frozen.
val of_list : (key * 'a) list ‑> 'a t
val add_seq : 'a t ‑> (key * 'a) sequence ‑> 'a t
val add_seq_mut : id:Transient.t ‑> 'a t ‑> (key * 'a) sequence ‑> 'a t
  • Raises Frozen: if the ID is frozen.
val of_seq : (key * 'a) sequence ‑> 'a t
val to_seq : 'a t ‑> (key * 'a) sequence
val add_gen : 'a t ‑> (key * 'a) gen ‑> 'a t
val add_gen_mut : id:Transient.t ‑> 'a t ‑> (key * 'a) gen ‑> 'a t
  • Raises Frozen: if the ID is frozen.
val of_gen : (key * 'a) gen ‑> 'a t
val to_gen : 'a t ‑> (key * 'a) gen
IO
val pp : key printer ‑> 'a printer ‑> 'a t printer

Renamed from val print.

  • Since: 2.0
val as_tree : 'a t ‑> [ `L of int * (key * 'a) list | `N ] ktree

For debugging purpose: explore the structure of the tree, +with `L (h,l) being a leaf (with shared hash h) +and `N an inner node.

\ No newline at end of file diff --git a/2.3/containers/CCHashTrie/Transient/index.html b/2.3/containers/CCHashTrie/Transient/index.html new file mode 100644 index 00000000..5736cdc9 --- /dev/null +++ b/2.3/containers/CCHashTrie/Transient/index.html @@ -0,0 +1,7 @@ + +Transient (containers.CCHashTrie.Transient)

Module CCHashTrie.Transient

Transient Identifiers

type t

Identifiers for transient modifications. A transient modification +is uniquely identified by a Transient.t. Once Transient.freeze r +is called, r cannot be used to modify the structure again.

val create : unit ‑> t

Create a new, active ID.

val equal : t ‑> t ‑> bool

Equality between IDs.

val frozen : t ‑> bool

frozen i returns true if freeze i was called before. In this case, +the ID cannot be used for modifications again.

val active : t ‑> bool

active i is not (frozen i).

val freeze : t ‑> unit

freeze i makes i unusable for new modifications. The values +created with i will now be immutable.

val with_ : (t ‑> 'a) ‑> 'a

with_ f creates a transient ID i, calls f i, +freezes the ID i and returns the result of f i.

exception Frozen

Raised when a frozen ID is used.

\ No newline at end of file diff --git a/2.3/containers/CCHashTrie/index.html b/2.3/containers/CCHashTrie/index.html new file mode 100644 index 00000000..6b2edcbe --- /dev/null +++ b/2.3/containers/CCHashTrie/index.html @@ -0,0 +1,6 @@ + +CCHashTrie (containers.CCHashTrie)

Module CCHashTrie

Hash Tries

Trie indexed by the hash of the keys, where the branching factor is fixed. +The goal is to have a quite efficient functional structure with fast +update and access if the hash function is good. +The trie is not binary, to improve cache locality and decrease depth.

Preliminary benchmarks (see the "tbl" section of benchmarks) tend to show +that this type is quite efficient for small data sets.

status: unstable

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a ktree = unit ‑> [ `Nil | `Node of 'a * 'a ktree list ]
module Transient : sig ... end

Transient Identifiers

module type S : sig ... end

Signature

module type KEY : sig ... end

Type for keys

module Make : functor (K : KEY) -> S with type key = K.t

Functors

\ No newline at end of file diff --git a/2.3/containers/CCHashTrie/module-type-KEY/index.html b/2.3/containers/CCHashTrie/module-type-KEY/index.html new file mode 100644 index 00000000..ba1d4196 --- /dev/null +++ b/2.3/containers/CCHashTrie/module-type-KEY/index.html @@ -0,0 +1,2 @@ + +KEY (containers.CCHashTrie.KEY)

Module type CCHashTrie.KEY

Type for keys

type t
val equal : t ‑> t ‑> bool
val hash : t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCHashTrie/module-type-S/index.html b/2.3/containers/CCHashTrie/module-type-S/index.html new file mode 100644 index 00000000..3c8b37d1 --- /dev/null +++ b/2.3/containers/CCHashTrie/module-type-S/index.html @@ -0,0 +1,9 @@ + +S (containers.CCHashTrie.S)

Module type CCHashTrie.S

Signature

type key
type 'a t
val empty : 'a t
val is_empty : _ t ‑> bool
val singleton : key ‑> 'a ‑> 'a t
val add : key ‑> 'a ‑> 'a t ‑> 'a t
val mem : key ‑> _ t ‑> bool
val get : key ‑> 'a t ‑> 'a option
val get_exn : key ‑> 'a t ‑> 'a
  • Raises Not_found: if key not present.
val remove : key ‑> 'a t ‑> 'a t

Remove the key, if present.

val update : key ‑> f:('a option ‑> 'a option) ‑> 'a t ‑> 'a t

update k ~f m calls f (Some v) if get k m = Some v, f None +otherwise. Then, if f returns Some v' it binds k to v', +if f returns None it removes k.

val add_mut : id:Transient.t ‑> key ‑> 'a ‑> 'a t ‑> 'a t

add_mut ~id k v m behaves like add k v m, except it will mutate +in place whenever possible. Changes done with an id might affect all +versions of the structure obtained with the same id (but not +other versions).

  • Raises Transient.Frozen: if id is frozen.
val remove_mut : id:Transient.t ‑> key ‑> 'a t ‑> 'a t

Same as remove, but modifies in place whenever possible.

  • Raises Transient.Frozen: if id is frozen.
val update_mut : id:Transient.t ‑> key ‑> f:('a option ‑> 'a option) ‑> 'a t ‑> 'a t

Same as update but with mutability.

  • Raises Transient.Frozen: if id is frozen.
val cardinal : _ t ‑> int
val choose : 'a t ‑> (key * 'a) option
val choose_exn : 'a t ‑> key * 'a
  • Raises Not_found: if not pair was found.
val iter : f:(key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val fold : f:('b ‑> key ‑> 'a ‑> 'b) ‑> x:'b ‑> 'a t ‑> 'b
Conversions
val to_list : 'a t ‑> (key * 'a) list
val add_list : 'a t ‑> (key * 'a) list ‑> 'a t
val add_list_mut : id:Transient.t ‑> 'a t ‑> (key * 'a) list ‑> 'a t
  • Raises Frozen: if the ID is frozen.
val of_list : (key * 'a) list ‑> 'a t
val add_seq : 'a t ‑> (key * 'a) sequence ‑> 'a t
val add_seq_mut : id:Transient.t ‑> 'a t ‑> (key * 'a) sequence ‑> 'a t
  • Raises Frozen: if the ID is frozen.
val of_seq : (key * 'a) sequence ‑> 'a t
val to_seq : 'a t ‑> (key * 'a) sequence
val add_gen : 'a t ‑> (key * 'a) gen ‑> 'a t
val add_gen_mut : id:Transient.t ‑> 'a t ‑> (key * 'a) gen ‑> 'a t
  • Raises Frozen: if the ID is frozen.
val of_gen : (key * 'a) gen ‑> 'a t
val to_gen : 'a t ‑> (key * 'a) gen
IO
val pp : key printer ‑> 'a printer ‑> 'a t printer

Renamed from val print.

  • Since: 2.0
val as_tree : 'a t ‑> [ `L of int * (key * 'a) list | `N ] ktree

For debugging purpose: explore the structure of the tree, +with `L (h,l) being a leaf (with shared hash h) +and `N an inner node.

\ No newline at end of file diff --git a/2.3/containers/CCHashtbl/.jbuilder-keep b/2.3/containers/CCHashtbl/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCHashtbl/Poly/index.html b/2.3/containers/CCHashtbl/Poly/index.html new file mode 100644 index 00000000..eb76cb98 --- /dev/null +++ b/2.3/containers/CCHashtbl/Poly/index.html @@ -0,0 +1,22 @@ + +Poly (containers.CCHashtbl.Poly)

Module CCHashtbl.Poly

val get : ('a'b) Hashtbl.t ‑> 'a ‑> 'b option

Safe version of Hashtbl.find.

val get_or : ('a'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'b

get_or tbl k ~default returns the value associated to k if present, +and returns default otherwise (if k doesn't belong in tbl).

  • Since: 0.16
val keys : ('a'b) Hashtbl.t ‑> 'a sequence

Iterate on keys (similar order as Hashtbl.iter).

val values : ('a'b) Hashtbl.t ‑> 'b sequence

Iterate on values in the table.

val keys_list : ('a'b) Hashtbl.t ‑> 'a list

keys_list t is the list of keys in t. +If the key is in the Hashtable multiple times, all occurrences will be returned.

  • Since: 0.8
val values_list : ('a'b) Hashtbl.t ‑> 'b list

values_list t is the list of values in t.

  • Since: 0.8
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a'b) Hashtbl.t ‑> 'c list

Map on a hashtable's items, collect into a list.

val incr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

incr ?by tbl x increments or initializes the counter associated with x. +If get tbl x = None, then after update, get tbl x = Some 1; +otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • Parameter by: if specified, the int value is incremented by by rather than 1.
  • Since: 0.16
val decr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

Like incr but subtract 1 (or the value of by). +If the value reaches 0, the key is removed from the table. +This does nothing if the key is not already present in the table.

  • Since: 0.16
val to_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) sequence

Iterate on bindings in the table.

val add_list : ('a'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unit

add_list tbl x y adds y to the list x is bound to. If x is +not bound, it becomes bound to y.

  • Since: 0.16
val add_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) sequence ‑> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • Since: 0.16
val of_seq : ('a * 'b) sequence ‑> ('a'b) Hashtbl.t

From the given bindings, added in order.

val add_seq_count : ('a, int) Hashtbl.t ‑> 'a sequence ‑> unit

add_seq_count tbl seq increments the count of each element of seq +by calling incr. This is useful for counting how many times each +element of seq occurs.

  • Since: 0.16
val of_seq_count : 'a sequence ‑> ('a, int) Hashtbl.t

Like add_seq_count, but allocates a new table and returns it.

  • Since: 0.16
val to_list : ('a'b) Hashtbl.t ‑> ('a * 'b) list

List of bindings (order unspecified).

val of_list : ('a * 'b) list ‑> ('a'b) Hashtbl.t

Build a table from the given list of bindings k_i -> v_i, +added in order using add. If a key occurs several times, +it will be added several times, and the visible binding +will be the last one.

val update : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b option ‑> 'b option) ‑> k:'a ‑> unit

update tbl ~f ~k updates key k by calling f k (Some v) if +k was mapped to v, or f k None otherwise; if the call +returns None then k is removed/stays removed, if the call +returns Some v' then the binding k -> v' is inserted +using Hashtbl.replace.

  • Since: 0.14
val get_or_add : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'b

get_or_add tbl ~k ~f finds and returns the binding of k +in tbl, if it exists. If it does not exist, then f k +is called to obtain a new binding v; k -> v is added +to tbl and v is returned.

  • Since: 1.0
val pp : 'a printer ‑> 'b printer ‑> ('a'b) Hashtbl.t printer

Printer for table. +Renamed from print since 2.0.

  • Since: 0.13
\ No newline at end of file diff --git a/2.3/containers/CCHashtbl/index.html b/2.3/containers/CCHashtbl/index.html new file mode 100644 index 00000000..80c066f5 --- /dev/null +++ b/2.3/containers/CCHashtbl/index.html @@ -0,0 +1,22 @@ + +CCHashtbl (containers.CCHashtbl)

Module CCHashtbl

Extension to the standard Hashtbl

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a eq = 'a ‑> 'a ‑> bool
type 'a hash = 'a ‑> int
type 'a printer = Format.formatter ‑> 'a ‑> unit

Polymorphic tables

This sub-module contains the extension of the standard polymorphic Hashtbl.

module Poly : sig ... end
include module type of Poly
val get : ('a'b) Hashtbl.t ‑> 'a ‑> 'b option

Safe version of Hashtbl.find.

val get_or : ('a'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'b

get_or tbl k ~default returns the value associated to k if present, +and returns default otherwise (if k doesn't belong in tbl).

  • Since: 0.16
val keys : ('a'b) Hashtbl.t ‑> 'a sequence

Iterate on keys (similar order as Hashtbl.iter).

val values : ('a'b) Hashtbl.t ‑> 'b sequence

Iterate on values in the table.

val keys_list : ('a'b) Hashtbl.t ‑> 'a list

keys_list t is the list of keys in t. +If the key is in the Hashtable multiple times, all occurrences will be returned.

  • Since: 0.8
val values_list : ('a'b) Hashtbl.t ‑> 'b list

values_list t is the list of values in t.

  • Since: 0.8
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a'b) Hashtbl.t ‑> 'c list

Map on a hashtable's items, collect into a list.

val incr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

incr ?by tbl x increments or initializes the counter associated with x. +If get tbl x = None, then after update, get tbl x = Some 1; +otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • Parameter by: if specified, the int value is incremented by by rather than 1.
  • Since: 0.16
val decr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

Like incr but subtract 1 (or the value of by). +If the value reaches 0, the key is removed from the table. +This does nothing if the key is not already present in the table.

  • Since: 0.16
val to_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) sequence

Iterate on bindings in the table.

val add_list : ('a'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unit

add_list tbl x y adds y to the list x is bound to. If x is +not bound, it becomes bound to y.

  • Since: 0.16
val add_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) sequence ‑> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • Since: 0.16
val of_seq : ('a * 'b) sequence ‑> ('a'b) Hashtbl.t

From the given bindings, added in order.

val add_seq_count : ('a, int) Hashtbl.t ‑> 'a sequence ‑> unit

add_seq_count tbl seq increments the count of each element of seq +by calling incr. This is useful for counting how many times each +element of seq occurs.

  • Since: 0.16
val of_seq_count : 'a sequence ‑> ('a, int) Hashtbl.t

Like add_seq_count, but allocates a new table and returns it.

  • Since: 0.16
val to_list : ('a'b) Hashtbl.t ‑> ('a * 'b) list

List of bindings (order unspecified).

val of_list : ('a * 'b) list ‑> ('a'b) Hashtbl.t

Build a table from the given list of bindings k_i -> v_i, +added in order using add. If a key occurs several times, +it will be added several times, and the visible binding +will be the last one.

val update : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b option ‑> 'b option) ‑> k:'a ‑> unit

update tbl ~f ~k updates key k by calling f k (Some v) if +k was mapped to v, or f k None otherwise; if the call +returns None then k is removed/stays removed, if the call +returns Some v' then the binding k -> v' is inserted +using Hashtbl.replace.

  • Since: 0.14
val get_or_add : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'b

get_or_add tbl ~k ~f finds and returns the binding of k +in tbl, if it exists. If it does not exist, then f k +is called to obtain a new binding v; k -> v is added +to tbl and v is returned.

  • Since: 1.0
val pp : 'a printer ‑> 'b printer ‑> ('a'b) Hashtbl.t printer

Printer for table. +Renamed from print since 2.0.

  • Since: 0.13

Functor

module type S : sig ... end
module Make : functor (X : Hashtbl.HashedType) -> S with type Make.key = X.t and type 'a Make.t = 'a Hashtbl.Make(X).t
\ No newline at end of file diff --git a/2.3/containers/CCHashtbl/module-type-S/index.html b/2.3/containers/CCHashtbl/module-type-S/index.html new file mode 100644 index 00000000..1c4a97fe --- /dev/null +++ b/2.3/containers/CCHashtbl/module-type-S/index.html @@ -0,0 +1,22 @@ + +S (containers.CCHashtbl.S)

Module type CCHashtbl.S

include Hashtbl.S
type key
type 'a t
val create : int ‑> 'a t
val clear : 'a t ‑> unit
val reset : 'a t ‑> unit
val copy : 'a t ‑> 'a t
val add : 'a t ‑> key ‑> 'a ‑> unit
val remove : 'a t ‑> key ‑> unit
val find : 'a t ‑> key ‑> 'a
val find_opt : 'a t ‑> key ‑> 'a option
val find_all : 'a t ‑> key ‑> 'a list
val replace : 'a t ‑> key ‑> 'a ‑> unit
val mem : 'a t ‑> key ‑> bool
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val filter_map_inplace : (key ‑> 'a ‑> 'a option) ‑> 'a t ‑> unit
val fold : (key ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
val length : 'a t ‑> int
val stats : 'a t ‑> Hashtbl.statistics
val get : 'a t ‑> key ‑> 'a option

Safe version of Hashtbl.find.

val get_or : 'a t ‑> key ‑> default:'a ‑> 'a

get_or tbl k ~default returns the value associated to k if present, +and returns default otherwise (if k doesn't belong in tbl).

  • Since: 0.16
val add_list : 'a list t ‑> key ‑> 'a ‑> unit

add_list tbl x y adds y to the list x is bound to. If x is +not bound, it becomes bound to y.

  • Since: 0.16
val incr : ?⁠by:int ‑> int t ‑> key ‑> unit

incr ?by tbl x increments or initializes the counter associated with x. +If get tbl x = None, then after update, get tbl x = Some 1; +otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • Parameter by: if specified, the int value is incremented by by rather than 1.
  • Since: 0.16
val decr : ?⁠by:int ‑> int t ‑> key ‑> unit

Like incr but subtract 1 (or the value of by). +If the value reaches 0, the key is removed from the table. +This does nothing if the key is not already present in the table.

  • Since: 0.16
val keys : 'a t ‑> key sequence

Iterate on keys (similar order as Hashtbl.iter).

val values : 'a t ‑> 'a sequence

Iterate on values in the table.

val keys_list : _ t ‑> key list

keys_list t is the list of keys in t. +If the key is in the Hashtable multiple times, all occurrences will be returned.

  • Since: 0.8
val values_list : 'a t ‑> 'a list

values_list t is the list of values in t.

  • Since: 0.8
val map_list : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b list

Map on a hashtable's items, collect into a list.

val to_seq : 'a t ‑> (key * 'a) sequence

Iterate on values in the table.

val of_seq : (key * 'a) sequence ‑> 'a t

From the given bindings, added in order.

val add_seq : 'a t ‑> (key * 'a) sequence ‑> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • Since: 0.16
val add_seq_count : int t ‑> key sequence ‑> unit

add_seq_count tbl seq increments the count of each element of seq +by calling incr. This is useful for counting how many times each +element of seq occurs.

  • Since: 0.16
val of_seq_count : key sequence ‑> int t

Like add_seq_count, but allocates a new table and returns it.

  • Since: 0.16
val to_list : 'a t ‑> (key * 'a) list

List of bindings (order unspecified).

val of_list : (key * 'a) list ‑> 'a t

Build a table from the given list of bindings k_i -> v_i, +added in order using add. If a key occurs several times, +it will be added several times, and the visible binding +will be the last one.

val update : 'a t ‑> f:(key ‑> 'a option ‑> 'a option) ‑> k:key ‑> unit

update tbl ~f ~k updates key k by calling f k (Some v) if +k was mapped to v, or f k None otherwise; if the call +returns None then k is removed/stays removed, if the call +returns Some v' then the binding k -> v' is inserted +using Hashtbl.replace.

  • Since: 0.14
val get_or_add : 'a t ‑> f:(key ‑> 'a) ‑> k:key ‑> 'a

get_or_add tbl ~k ~f finds and returns the binding of k +in tbl, if it exists. If it does not exist, then f k +is called to obtain a new binding v; k -> v is added +to tbl and v is returned.

  • Since: 1.0
val pp : key printer ‑> 'a printer ‑> 'a t printer

Printer for tables. +Renamed from print since 2.0.

  • Since: 0.13
\ No newline at end of file diff --git a/2.3/containers/CCHeap/.jbuilder-keep b/2.3/containers/CCHeap/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCHeap/Make/argument-1-E/index.html b/2.3/containers/CCHeap/Make/argument-1-E/index.html new file mode 100644 index 00000000..6173385d --- /dev/null +++ b/2.3/containers/CCHeap/Make/argument-1-E/index.html @@ -0,0 +1,2 @@ + +1-E (containers.CCHeap.Make.1-E)

Parameter CCHeap.Make.1-E

type t
val leq : t ‑> t ‑> bool

leq x y shall return true iff x is lower or equal to y.

\ No newline at end of file diff --git a/2.3/containers/CCHeap/Make/index.html b/2.3/containers/CCHeap/Make/index.html new file mode 100644 index 00000000..d3a108e8 --- /dev/null +++ b/2.3/containers/CCHeap/Make/index.html @@ -0,0 +1,14 @@ + +Make (containers.CCHeap.Make)

Module CCHeap.Make

Parameters

Signature

type elt = E.t
type t
val empty : t

Empty heap.

val is_empty : t ‑> bool

Is the heap empty?

exception Empty
val merge : t ‑> t ‑> t

Merge two heaps.

val insert : elt ‑> t ‑> t

Insert a value in the heap.

val add : t ‑> elt ‑> t

Synonym to insert.

val filter : (elt ‑> bool) ‑> t ‑> t

Filter values, only retaining the ones that satisfy the predicate. +Linear time at least.

val find_min : t ‑> elt option

Find minimal element.

val find_min_exn : t ‑> elt

Like find_min but can fail.

  • Raises Empty: if the heap is empty.
val take : t ‑> (t * elt) option

Extract and return the minimum element, and the new heap (without +this element), or None if the heap is empty.

val take_exn : t ‑> t * elt

Like take, but can fail.

  • Raises Empty: if the heap is empty.
val delete_one : (elt ‑> elt ‑> bool) ‑> elt ‑> t ‑> t

Delete one occurrence of a value if it exist in the heap. +delete_one eq x h, use eq to find one x in h and delete it. +If h do not contain x then it return h.

  • Since: 2.0
val delete_all : (elt ‑> elt ‑> bool) ‑> elt ‑> t ‑> t

Delete all occurrences of a value in the heap. +delete_all eq x h, use eq to find all x in h and delete them. +If h do not contain x then it return h. +The difference with filter is that delete_all stops as soon as +it enters a subtree whose root is bigger than the element.

  • Since: 2.0
val iter : (elt ‑> unit) ‑> t ‑> unit

Iterate on elements.

val fold : ('a ‑> elt ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on all values.

val size : t ‑> int

Number of elements (linear complexity).

Conversions

The interface of of_gen, of_seq, of_klist +has changed since 0.16 (the old signatures +are now add_seq, add_gen, add_klist).

val to_list : t ‑> elt list

Return the elements of the heap, in no particular order.

val to_list_sorted : t ‑> elt list

Return the elements in increasing order.

  • Since: 1.1
val add_list : t ‑> elt list ‑> t

Add the elements of the list to the heap. An element occurring several +times will be added that many times to the heap.

  • Since: 0.16
val of_list : elt list ‑> t

of_list l is add_list empty l. Complexity: O(n log n).

val add_seq : t ‑> elt sequence ‑> t
  • Since: 0.16
val of_seq : elt sequence ‑> t

Build a heap from a given sequence. Complexity: O(n log n).

val to_seq : t ‑> elt sequence

Return a sequence of the elements of the heap.

val to_seq_sorted : t ‑> elt sequence

Iterate on the elements, in increasing order.

  • Since: 1.1
val add_klist : t ‑> elt klist ‑> t
  • Since: 0.16
val of_klist : elt klist ‑> t

Build a heap from a given klist. Complexity: O(n log n).

val to_klist : t ‑> elt klist

Return a klist of the elements of the heap.

val add_gen : t ‑> elt gen ‑> t
  • Since: 0.16
val of_gen : elt gen ‑> t

Build a heap from a given gen. Complexity: O(n log n).

val to_gen : t ‑> elt gen

Return a gen of the elements of the heap.

val to_tree : t ‑> elt ktree

Return a ktree of the elements of the heap.

val pp : ?⁠sep:string ‑> elt printer ‑> t printer

Printer. +Renamed from print since 2.0

  • Since: 0.16
\ No newline at end of file diff --git a/2.3/containers/CCHeap/Make_from_compare/argument-1-E/index.html b/2.3/containers/CCHeap/Make_from_compare/argument-1-E/index.html new file mode 100644 index 00000000..0b4b83e7 --- /dev/null +++ b/2.3/containers/CCHeap/Make_from_compare/argument-1-E/index.html @@ -0,0 +1,5 @@ + +1-E (containers.CCHeap.Make_from_compare.1-E)

Parameter CCHeap.Make_from_compare.1-E

type t
val compare : t ‑> t ‑> int

compare a b shall return +a negative value if a is smaller than b, +0 if a and b are equal or +a positive value if a is greater than b

\ No newline at end of file diff --git a/2.3/containers/CCHeap/Make_from_compare/index.html b/2.3/containers/CCHeap/Make_from_compare/index.html new file mode 100644 index 00000000..6c8d28d8 --- /dev/null +++ b/2.3/containers/CCHeap/Make_from_compare/index.html @@ -0,0 +1,17 @@ + +Make_from_compare (containers.CCHeap.Make_from_compare)

Module CCHeap.Make_from_compare

A convenient version of Make that take a TOTAL_ORD instead of +a partially ordered module. +It allow to directly pass modules that implement compare +without implementing leq explicitly

Parameters

Signature

type elt = E.t
type t
val empty : t

Empty heap.

val is_empty : t ‑> bool

Is the heap empty?

exception Empty
val merge : t ‑> t ‑> t

Merge two heaps.

val insert : elt ‑> t ‑> t

Insert a value in the heap.

val add : t ‑> elt ‑> t

Synonym to insert.

val filter : (elt ‑> bool) ‑> t ‑> t

Filter values, only retaining the ones that satisfy the predicate. +Linear time at least.

val find_min : t ‑> elt option

Find minimal element.

val find_min_exn : t ‑> elt

Like find_min but can fail.

  • Raises Empty: if the heap is empty.
val take : t ‑> (t * elt) option

Extract and return the minimum element, and the new heap (without +this element), or None if the heap is empty.

val take_exn : t ‑> t * elt

Like take, but can fail.

  • Raises Empty: if the heap is empty.
val delete_one : (elt ‑> elt ‑> bool) ‑> elt ‑> t ‑> t

Delete one occurrence of a value if it exist in the heap. +delete_one eq x h, use eq to find one x in h and delete it. +If h do not contain x then it return h.

  • Since: 2.0
val delete_all : (elt ‑> elt ‑> bool) ‑> elt ‑> t ‑> t

Delete all occurrences of a value in the heap. +delete_all eq x h, use eq to find all x in h and delete them. +If h do not contain x then it return h. +The difference with filter is that delete_all stops as soon as +it enters a subtree whose root is bigger than the element.

  • Since: 2.0
val iter : (elt ‑> unit) ‑> t ‑> unit

Iterate on elements.

val fold : ('a ‑> elt ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on all values.

val size : t ‑> int

Number of elements (linear complexity).

Conversions

The interface of of_gen, of_seq, of_klist +has changed since 0.16 (the old signatures +are now add_seq, add_gen, add_klist).

val to_list : t ‑> elt list

Return the elements of the heap, in no particular order.

val to_list_sorted : t ‑> elt list

Return the elements in increasing order.

  • Since: 1.1
val add_list : t ‑> elt list ‑> t

Add the elements of the list to the heap. An element occurring several +times will be added that many times to the heap.

  • Since: 0.16
val of_list : elt list ‑> t

of_list l is add_list empty l. Complexity: O(n log n).

val add_seq : t ‑> elt sequence ‑> t
  • Since: 0.16
val of_seq : elt sequence ‑> t

Build a heap from a given sequence. Complexity: O(n log n).

val to_seq : t ‑> elt sequence

Return a sequence of the elements of the heap.

val to_seq_sorted : t ‑> elt sequence

Iterate on the elements, in increasing order.

  • Since: 1.1
val add_klist : t ‑> elt klist ‑> t
  • Since: 0.16
val of_klist : elt klist ‑> t

Build a heap from a given klist. Complexity: O(n log n).

val to_klist : t ‑> elt klist

Return a klist of the elements of the heap.

val add_gen : t ‑> elt gen ‑> t
  • Since: 0.16
val of_gen : elt gen ‑> t

Build a heap from a given gen. Complexity: O(n log n).

val to_gen : t ‑> elt gen

Return a gen of the elements of the heap.

val to_tree : t ‑> elt ktree

Return a ktree of the elements of the heap.

val pp : ?⁠sep:string ‑> elt printer ‑> t printer

Printer. +Renamed from print since 2.0

  • Since: 0.16
\ No newline at end of file diff --git a/2.3/containers/CCHeap/index.html b/2.3/containers/CCHeap/index.html new file mode 100644 index 00000000..ce5c1e19 --- /dev/null +++ b/2.3/containers/CCHeap/index.html @@ -0,0 +1,5 @@ + +CCHeap (containers.CCHeap)

Module CCHeap

Leftist Heaps

following Okasaki

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a ktree = unit ‑> [ `Nil | `Node of 'a * 'a ktree list ]
type 'a printer = Format.formatter ‑> 'a ‑> unit
module type PARTIAL_ORD : sig ... end
module type TOTAL_ORD : sig ... end
module type S : sig ... end
module Make : functor (E : PARTIAL_ORD) -> S with type elt = E.t
module Make_from_compare : functor (E : TOTAL_ORD) -> S with type elt = E.t

A convenient version of Make that take a TOTAL_ORD instead of +a partially ordered module. +It allow to directly pass modules that implement compare +without implementing leq explicitly

\ No newline at end of file diff --git a/2.3/containers/CCHeap/module-type-PARTIAL_ORD/index.html b/2.3/containers/CCHeap/module-type-PARTIAL_ORD/index.html new file mode 100644 index 00000000..b5e693f3 --- /dev/null +++ b/2.3/containers/CCHeap/module-type-PARTIAL_ORD/index.html @@ -0,0 +1,2 @@ + +PARTIAL_ORD (containers.CCHeap.PARTIAL_ORD)

Module type CCHeap.PARTIAL_ORD

type t
val leq : t ‑> t ‑> bool

leq x y shall return true iff x is lower or equal to y.

\ No newline at end of file diff --git a/2.3/containers/CCHeap/module-type-S/index.html b/2.3/containers/CCHeap/module-type-S/index.html new file mode 100644 index 00000000..8ee07899 --- /dev/null +++ b/2.3/containers/CCHeap/module-type-S/index.html @@ -0,0 +1,14 @@ + +S (containers.CCHeap.S)

Module type CCHeap.S

type elt
type t
val empty : t

Empty heap.

val is_empty : t ‑> bool

Is the heap empty?

exception Empty
val merge : t ‑> t ‑> t

Merge two heaps.

val insert : elt ‑> t ‑> t

Insert a value in the heap.

val add : t ‑> elt ‑> t

Synonym to insert.

val filter : (elt ‑> bool) ‑> t ‑> t

Filter values, only retaining the ones that satisfy the predicate. +Linear time at least.

val find_min : t ‑> elt option

Find minimal element.

val find_min_exn : t ‑> elt

Like find_min but can fail.

  • Raises Empty: if the heap is empty.
val take : t ‑> (t * elt) option

Extract and return the minimum element, and the new heap (without +this element), or None if the heap is empty.

val take_exn : t ‑> t * elt

Like take, but can fail.

  • Raises Empty: if the heap is empty.
val delete_one : (elt ‑> elt ‑> bool) ‑> elt ‑> t ‑> t

Delete one occurrence of a value if it exist in the heap. +delete_one eq x h, use eq to find one x in h and delete it. +If h do not contain x then it return h.

  • Since: 2.0
val delete_all : (elt ‑> elt ‑> bool) ‑> elt ‑> t ‑> t

Delete all occurrences of a value in the heap. +delete_all eq x h, use eq to find all x in h and delete them. +If h do not contain x then it return h. +The difference with filter is that delete_all stops as soon as +it enters a subtree whose root is bigger than the element.

  • Since: 2.0
val iter : (elt ‑> unit) ‑> t ‑> unit

Iterate on elements.

val fold : ('a ‑> elt ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on all values.

val size : t ‑> int

Number of elements (linear complexity).

Conversions

The interface of of_gen, of_seq, of_klist +has changed since 0.16 (the old signatures +are now add_seq, add_gen, add_klist).

val to_list : t ‑> elt list

Return the elements of the heap, in no particular order.

val to_list_sorted : t ‑> elt list

Return the elements in increasing order.

  • Since: 1.1
val add_list : t ‑> elt list ‑> t

Add the elements of the list to the heap. An element occurring several +times will be added that many times to the heap.

  • Since: 0.16
val of_list : elt list ‑> t

of_list l is add_list empty l. Complexity: O(n log n).

val add_seq : t ‑> elt sequence ‑> t
  • Since: 0.16
val of_seq : elt sequence ‑> t

Build a heap from a given sequence. Complexity: O(n log n).

val to_seq : t ‑> elt sequence

Return a sequence of the elements of the heap.

val to_seq_sorted : t ‑> elt sequence

Iterate on the elements, in increasing order.

  • Since: 1.1
val add_klist : t ‑> elt klist ‑> t
  • Since: 0.16
val of_klist : elt klist ‑> t

Build a heap from a given klist. Complexity: O(n log n).

val to_klist : t ‑> elt klist

Return a klist of the elements of the heap.

val add_gen : t ‑> elt gen ‑> t
  • Since: 0.16
val of_gen : elt gen ‑> t

Build a heap from a given gen. Complexity: O(n log n).

val to_gen : t ‑> elt gen

Return a gen of the elements of the heap.

val to_tree : t ‑> elt ktree

Return a ktree of the elements of the heap.

val pp : ?⁠sep:string ‑> elt printer ‑> t printer

Printer. +Renamed from print since 2.0

  • Since: 0.16
\ No newline at end of file diff --git a/2.3/containers/CCHeap/module-type-TOTAL_ORD/index.html b/2.3/containers/CCHeap/module-type-TOTAL_ORD/index.html new file mode 100644 index 00000000..015ea036 --- /dev/null +++ b/2.3/containers/CCHeap/module-type-TOTAL_ORD/index.html @@ -0,0 +1,5 @@ + +TOTAL_ORD (containers.CCHeap.TOTAL_ORD)

Module type CCHeap.TOTAL_ORD

type t
val compare : t ‑> t ‑> int

compare a b shall return +a negative value if a is smaller than b, +0 if a and b are equal or +a positive value if a is greater than b

\ No newline at end of file diff --git a/2.3/containers/CCHet/.jbuilder-keep b/2.3/containers/CCHet/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCHet/Key/index.html b/2.3/containers/CCHet/Key/index.html new file mode 100644 index 00000000..3d1e7ddb --- /dev/null +++ b/2.3/containers/CCHet/Key/index.html @@ -0,0 +1,2 @@ + +Key (containers.CCHet.Key)

Module CCHet.Key

type 'a t
val create : unit ‑> 'a t
val equal : 'a t ‑> 'a t ‑> bool

Compare two keys that have compatible types.

\ No newline at end of file diff --git a/2.3/containers/CCHet/Map/index.html b/2.3/containers/CCHet/Map/index.html new file mode 100644 index 00000000..acf759fd --- /dev/null +++ b/2.3/containers/CCHet/Map/index.html @@ -0,0 +1,2 @@ + +Map (containers.CCHet.Map)

Module CCHet.Map

Immutable map

type t
val empty : t
val mem : _ Key.t ‑> t ‑> bool
val add : 'a Key.t ‑> 'a ‑> t ‑> t
val length : t ‑> int
val cardinal : t ‑> int
val find : 'a Key.t ‑> t ‑> 'a option
val find_exn : 'a Key.t ‑> t ‑> 'a
  • Raises Not_found: if the key is not in the table.
val iter : (pair ‑> unit) ‑> t ‑> unit
val to_seq : t ‑> pair sequence
val of_seq : pair sequence ‑> t
val add_seq : t ‑> pair sequence ‑> t
val add_list : t ‑> pair list ‑> t
val of_list : pair list ‑> t
val to_list : t ‑> pair list
\ No newline at end of file diff --git a/2.3/containers/CCHet/Tbl/index.html b/2.3/containers/CCHet/Tbl/index.html new file mode 100644 index 00000000..232891c0 --- /dev/null +++ b/2.3/containers/CCHet/Tbl/index.html @@ -0,0 +1,2 @@ + +Tbl (containers.CCHet.Tbl)

Module CCHet.Tbl

Imperative table indexed by Key

type t
val create : ?⁠size:int ‑> unit ‑> t
val mem : t ‑> _ Key.t ‑> bool
val add : t ‑> 'a Key.t ‑> 'a ‑> unit
val length : t ‑> int
val find : t ‑> 'a Key.t ‑> 'a option
val find_exn : t ‑> 'a Key.t ‑> 'a
  • Raises Not_found: if the key is not in the table.
val iter : (pair ‑> unit) ‑> t ‑> unit
val to_seq : t ‑> pair sequence
val of_seq : pair sequence ‑> t
val add_seq : t ‑> pair sequence ‑> unit
val add_list : t ‑> pair list ‑> unit
val of_list : pair list ‑> t
val to_list : t ‑> pair list
\ No newline at end of file diff --git a/2.3/containers/CCHet/index.html b/2.3/containers/CCHet/index.html new file mode 100644 index 00000000..20b1cd33 --- /dev/null +++ b/2.3/containers/CCHet/index.html @@ -0,0 +1,3 @@ + +CCHet (containers.CCHet)

Module CCHet

Associative containers with Heterogeneous Values

This is similar to CCMixtbl, but the injection is directly used as +a key.

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
module Key : sig ... end
type pair =
| Pair : 'a Key.t * 'a ‑> pair
module Tbl : sig ... end

Imperative table indexed by Key

module Map : sig ... end

Immutable map

\ No newline at end of file diff --git a/2.3/containers/CCIO/.jbuilder-keep b/2.3/containers/CCIO/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCIO/File/index.html b/2.3/containers/CCIO/File/index.html new file mode 100644 index 00000000..510e259d --- /dev/null +++ b/2.3/containers/CCIO/File/index.html @@ -0,0 +1,14 @@ + +File (containers.CCIO.File)

Module CCIO.File

type t = string

A file should be represented by its absolute path, but currently +this is not enforced.

val to_string : t ‑> string
val make : string ‑> t

Build a file representation from a path (absolute or relative).

val exists : t ‑> bool
val is_directory : t ‑> bool
val remove_exn : t ‑> unit

remove_exn path tries to remove the file at path from the +file system.

  • Raises Sys_error: if there is no file at path or access rights are wrong.
  • Since: 0.8
val remove : t ‑> unit or_error

Like remove_exn but with an error monad.

  • Since: 0.8
val remove_noerr : t ‑> unit

Like remove_exn but do not raise any exception on failure.

  • Since: 0.8
val read_dir : ?⁠recurse:bool ‑> t ‑> t gen

read_dir d returns a sequence of files and directory contained +in the directory d (or an empty stream if d is not a directory).

  • Raises Sys_error: in case of error (e.g. permission denied).
  • Parameter recurse: if true (default false), sub-directories are also +explored.
val read_exn : t ‑> string

Read the content of the given file, or raises some exception.

  • Raises Sys_error: in case of error.
  • Since: 0.16
val read : t ‑> string or_error

Read the content of the given file.

  • Since: 0.16
val append_exn : t ‑> string ‑> unit

Append the given string into the given file, possibly raising.

  • Raises Sys_error: in case of error.
  • Since: 0.16
val append : t ‑> string ‑> unit or_error

Append the given string into the given file.

  • Since: 0.16
val write_exn : t ‑> string ‑> unit

Write the given string into the given file, possibly raising.

  • Raises Sys_error: in case of error.
  • Since: 0.16
val write : t ‑> string ‑> unit or_error

Write the given string into the given file.

  • Since: 0.16
type walk_item = [ `File | `Dir ] * t
val walk : t ‑> walk_item gen

Like read_dir (with recurse=true), this function walks +a directory recursively and yields either files or directories. +Is a file anything that doesn't satisfy is_directory (including +symlinks, etc.)

  • Raises Sys_error: in case of error (e.g. permission denied) during iteration.
val walk_l : t ‑> walk_item list

Like walk but returns a list (therefore it's eager and might +take some time on large directories).

  • Since: 1.1
val show_walk_item : walk_item ‑> string
val with_temp : ?⁠temp_dir:string ‑> prefix:string ‑> suffix:string ‑> (string ‑> 'a) ‑> 'a

with_temp ~prefix ~suffix f will call f with the name of a new +temporary file (located in temp_dir). +After f returns, the file is deleted. Best to be used in +combination with with_out. +See Filename.temp_file.

  • Since: 0.17
\ No newline at end of file diff --git a/2.3/containers/CCIO/index.html b/2.3/containers/CCIO/index.html new file mode 100644 index 00000000..d71a58b9 --- /dev/null +++ b/2.3/containers/CCIO/index.html @@ -0,0 +1,23 @@ + +CCIO (containers.CCIO)

Module CCIO

IO Utils

Simple utilities to deal with basic Input/Output tasks in a resource-safe +way. For advanced IO tasks, the user is advised to use something +like Lwt or Async, that are far more comprehensive.

Examples:

      # let l = CCIO.(with_in "/tmp/some_file" read_lines);;
      # CCIO.(
+          with_in "/tmp/input"
+            (fun ic ->
+               let chunks = read_chunks ic in
+               with_out ~flags:[Open_binary] ~mode:0o644 "/tmp/output"
+                 (fun oc ->
+                    write_gen oc chunks
+                 )
+            )
+        ) ;;
type 'a or_error = ('a, string) Result.result
type 'a gen = unit ‑> 'a option

See Gen in the gen library.

Input

val with_in : ?⁠mode:int ‑> ?⁠flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.in_channel ‑> 'a) ‑> 'a

Open an input file with the given optional flag list, calls the function +on the input channel. When the function raises or returns, the +channel is closed.

  • Raises Sys_error: in case of error (same as open_in and close_in).
  • Parameter flags: opening flags (default [Open_text]). Open_rdonly is used in any cases.
val read_chunks : ?⁠size:int ‑> Pervasives.in_channel ‑> string gen

Read the channel's content into chunks of size size.

val read_line : Pervasives.in_channel ‑> string option

Read a line from the channel. Returns None if the input is terminated. +The "\n" is removed from the line.

val read_lines : Pervasives.in_channel ‑> string gen

Read all lines. The generator should be traversed only once.

val read_lines_l : Pervasives.in_channel ‑> string list

Read all lines into a list.

val read_all : ?⁠size:int ‑> Pervasives.in_channel ‑> string

Read the whole channel into a buffer, then converted into a string.

  • Parameter size: the internal buffer size.
  • Since: 0.7
val read_all_bytes : ?⁠size:int ‑> Pervasives.in_channel ‑> Bytes.t

Read the whole channel into a mutable byte array.

  • Parameter size: the internal buffer size.
  • Since: 0.12

Output

val with_out : ?⁠mode:int ‑> ?⁠flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.out_channel ‑> 'a) ‑> 'a

Like with_in but for an output channel.

  • Parameter flags: opening flags (default [Open_creat; Open_trunc; Open_text]).
  • Raises Sys_error: in case of error (same as open_out and close_out). +Open_wronly is used in any cases.
val with_out_a : ?⁠mode:int ‑> ?⁠flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.out_channel ‑> 'a) ‑> 'a

Like with_out but with the [Open_append; Open_creat; Open_wronly] +flags activated, to append to the file.

  • Raises Sys_error: in case of error (same as open_out and close_out).
val write_line : Pervasives.out_channel ‑> string ‑> unit

Write the given string on the channel, followed by "\n".

val write_gen : ?⁠sep:string ‑> Pervasives.out_channel ‑> string gen ‑> unit

Write the given strings on the output. If provided, add sep between +every two strings (but not at the end).

val write_lines : Pervasives.out_channel ‑> string gen ‑> unit

Write every string on the output, followed by "\n".

val write_lines_l : Pervasives.out_channel ‑> string list ‑> unit

Both

val with_in_out : ?⁠mode:int ‑> ?⁠flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.in_channel ‑> Pervasives.out_channel ‑> 'a) ‑> 'a

Combines with_in and with_out.

  • Parameter flags: opening flags (default [Open_creat]).
  • Raises Sys_error: in case of error.
  • Since: 0.12

Misc for Generators

val tee : ('a ‑> unit) list ‑> 'a gen ‑> 'a gen

tee funs gen behaves like gen, but each element is given to +every function f in funs at the time the element is produced.

File and file names

How to list recursively files in a directory: +

      # let files = CCIO.File.read_dir ~recurse:true (CCIO.File.make "/tmp");;
+      # CCIO.write_lines stdout files;;

See File.walk if you also need to list directories:

      # let content = CCIO.File.walk (CCIO.File.make "/tmp");;
+      # Gen.map CCIO.File.show_walk_item content |> CCIO.write_lines stdout;;
module File : sig ... end
\ No newline at end of file diff --git a/2.3/containers/CCImmutArray/.jbuilder-keep b/2.3/containers/CCImmutArray/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCImmutArray/index.html b/2.3/containers/CCImmutArray/index.html new file mode 100644 index 00000000..59ecfaa0 --- /dev/null +++ b/2.3/containers/CCImmutArray/index.html @@ -0,0 +1,8 @@ + +CCImmutArray (containers.CCImmutArray)

Module CCImmutArray

Immutable Arrays

Purely functional use of arrays. Update is costly, but reads are very fast. +Sadly, it is not possible to make this type covariant without using black +magic.

type 'a t

Array of values of type 'a. The underlying type really is +an array, but it will never be modified.

It should be covariant but OCaml will not accept it.

val empty : 'a t
val length : _ t ‑> int
val singleton : 'a ‑> 'a t
val doubleton : 'a ‑> 'a ‑> 'a t
val make : int ‑> 'a ‑> 'a t

make n x makes an array of n times x.

val init : int ‑> (int ‑> 'a) ‑> 'a t

init n f makes the array [| f 0; f 1; ... ; f (n-1) |].

  • Raises Invalid_argument: if n < 0.
val get : 'a t ‑> int ‑> 'a

Access the element.

val set : 'a t ‑> int ‑> 'a ‑> 'a t

Copy the array and modify its copy.

val sub : 'a t ‑> int ‑> int ‑> 'a t

sub a start len returns a fresh array of length len, containing the elements +from start to pstart + len - 1 of array a.

Raises Invalid_argument "Array.sub" if start and len do not designate a +valid subarray of a; that is, if start < 0, or len < 0, or start + len > Array.length a.

  • Since: 1.5
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t
val mapi : (int ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t
val append : 'a t ‑> 'a t ‑> 'a t
val iter : ('a ‑> unit) ‑> 'a t ‑> unit
val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val foldi : ('a ‑> int ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a
val fold : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a
val for_all : ('a ‑> bool) ‑> 'a t ‑> bool
val exists : ('a ‑> bool) ‑> 'a t ‑> bool

Conversions

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
val of_list : 'a list ‑> 'a t
val to_list : 'a t ‑> 'a list
val of_array_unsafe : 'a array ‑> 'a t

Take ownership of the given array. Careful, the array must NOT +be modified afterwards!

val to_seq : 'a t ‑> 'a sequence
val of_seq : 'a sequence ‑> 'a t
val of_gen : 'a gen ‑> 'a t
val to_gen : 'a t ‑> 'a gen

IO

type 'a printer = Format.formatter ‑> 'a ‑> unit
val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a printer ‑> 'a t printer
\ No newline at end of file diff --git a/2.3/containers/CCInt/.jbuilder-keep b/2.3/containers/CCInt/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCInt/Infix/index.html b/2.3/containers/CCInt/Infix/index.html new file mode 100644 index 00000000..8b3da310 --- /dev/null +++ b/2.3/containers/CCInt/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCInt.Infix)

Module CCInt.Infix

val (=) : t ‑> t ‑> bool
  • Since: 0.17
val (<>) : t ‑> t ‑> bool
  • Since: 0.17
val (<) : t ‑> t ‑> bool
  • Since: 0.17
val (>) : t ‑> t ‑> bool
  • Since: 0.17
val (<=) : t ‑> t ‑> bool
  • Since: 0.17
val (>=) : t ‑> t ‑> bool
  • Since: 0.17
val (--) : t ‑> t ‑> t sequence

Alias to range.

  • Since: 1.2
val (--^) : t ‑> t ‑> t sequence

Alias to range'.

  • Since: 1.2
val (+) : t ‑> t ‑> t
  • Since: 2.1
val (-) : t ‑> t ‑> t
  • Since: 2.1
val (~-) : t ‑> t
  • Since: 2.1
val (*) : t ‑> t ‑> t
  • Since: 2.1
val (/) : t ‑> t ‑> t
  • Since: 2.1
val (mod) : t ‑> t ‑> t
  • Since: 2.1
val (land) : t ‑> t ‑> t
  • Since: 2.1
val (lor) : t ‑> t ‑> t
  • Since: 2.1
val (lxor) : t ‑> t ‑> t
  • Since: 2.1
val (lnot) : t ‑> t
  • Since: 2.1
val (lsl) : t ‑> int ‑> t
  • Since: 2.1
val (lsr) : t ‑> int ‑> t
  • Since: 2.1
val (asr) : t ‑> int ‑> t
  • Since: 2.1
\ No newline at end of file diff --git a/2.3/containers/CCInt/index.html b/2.3/containers/CCInt/index.html new file mode 100644 index 00000000..2a85b486 --- /dev/null +++ b/2.3/containers/CCInt/index.html @@ -0,0 +1,10 @@ + +CCInt (containers.CCInt)

Module CCInt

Basic Int functions

type t = int
val compare : t ‑> t ‑> int

The comparison function for integers with the same specification as Pervasives.compare.

val equal : t ‑> t ‑> bool

Equality function for integers.

val hash : t ‑> int
val sign : t ‑> int

sign i is one of -1, 0, 1.

val neg : t ‑> t

Unary negation. neg i = - i.

  • Since: 0.5
val pow : t ‑> t ‑> t

pow base exponent returns base raised to the power of exponent. +pow a b = a^b for positive integers a and b. +Raises Invalid_argument if a = b = 0 or b < 0.

  • Since: 0.11
val floor_div : t ‑> t ‑> t

floor_div a n is integer division rounding towards negative infinity. +It satisfies a = m * floor_div a n + rem a n.

  • Since: 1.2
val rem : t ‑> t ‑> t

rem a n is the remainder of dividing a by n, with the same +sign as n.

  • Since: 1.2
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a random_gen = Random.State.t ‑> 'a
type 'a sequence = ('a ‑> unit) ‑> unit
val random : int ‑> t random_gen
val random_small : t random_gen
val random_range : int ‑> int ‑> t random_gen
val pp : t printer
val to_string : t ‑> string

Return the string representation of its argument, in signed decimal.

  • Since: 0.13
val of_string : string ‑> t option
  • Since: 0.13
val pp_binary : t printer

Print as "0b00101010".

  • Since: 0.20
val to_string_binary : t ‑> string
  • Since: 0.20
val min : t ‑> t ‑> t

The minimum of two integers.

  • Since: 0.17
val max : t ‑> t ‑> t

The maximum of two integers.

  • Since: 0.17
val range_by : step:t ‑> t ‑> t ‑> t sequence

range_by ~step i j iterates on integers from i to j included, +where the difference between successive elements is step. +Use a negative step for a decreasing list.

  • Raises Invalid_argument: if step=0.
  • Since: 1.2
val range : t ‑> t ‑> t sequence

range i j iterates on integers from i to j included . It works +both for decreasing and increasing ranges.

  • Since: 1.2
val range' : t ‑> t ‑> t sequence

Like range but the second bound is excluded. +For instance range' 0 5 = Sequence.of_list [0;1;2;3;4].

  • Since: 1.2

Infix Operators

module Infix : sig ... end
include module type of Infix
val (=) : t ‑> t ‑> bool
  • Since: 0.17
val (<>) : t ‑> t ‑> bool
  • Since: 0.17
val (<) : t ‑> t ‑> bool
  • Since: 0.17
val (>) : t ‑> t ‑> bool
  • Since: 0.17
val (<=) : t ‑> t ‑> bool
  • Since: 0.17
val (>=) : t ‑> t ‑> bool
  • Since: 0.17
val (--) : t ‑> t ‑> t sequence

Alias to range.

  • Since: 1.2
val (--^) : t ‑> t ‑> t sequence

Alias to range'.

  • Since: 1.2
val (+) : t ‑> t ‑> t
  • Since: 2.1
val (-) : t ‑> t ‑> t
  • Since: 2.1
val (~-) : t ‑> t
  • Since: 2.1
val (*) : t ‑> t ‑> t
  • Since: 2.1
val (/) : t ‑> t ‑> t
  • Since: 2.1
val (mod) : t ‑> t ‑> t
  • Since: 2.1
val (land) : t ‑> t ‑> t
  • Since: 2.1
val (lor) : t ‑> t ‑> t
  • Since: 2.1
val (lxor) : t ‑> t ‑> t
  • Since: 2.1
val (lnot) : t ‑> t
  • Since: 2.1
val (lsl) : t ‑> int ‑> t
  • Since: 2.1
val (lsr) : t ‑> int ‑> t
  • Since: 2.1
val (asr) : t ‑> int ‑> t
  • Since: 2.1
\ No newline at end of file diff --git a/2.3/containers/CCInt32/.jbuilder-keep b/2.3/containers/CCInt32/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCInt32/Infix/index.html b/2.3/containers/CCInt32/Infix/index.html new file mode 100644 index 00000000..df1e809f --- /dev/null +++ b/2.3/containers/CCInt32/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCInt32.Infix)

Module CCInt32.Infix

val (+) : t ‑> t ‑> t
val (-) : t ‑> t ‑> t
val (~-) : t ‑> t
val (*) : t ‑> t ‑> t
val (/) : t ‑> t ‑> t
val (mod) : t ‑> t ‑> t
val (land) : t ‑> t ‑> t
val (lor) : t ‑> t ‑> t
val (lxor) : t ‑> t ‑> t
val (lnot) : t ‑> t
val (lsl) : t ‑> int ‑> t
val (lsr) : t ‑> int ‑> t
val (asr) : t ‑> int ‑> t
val (=) : t ‑> t ‑> bool
val (<>) : t ‑> t ‑> bool
val (>) : t ‑> t ‑> bool
val (>=) : t ‑> t ‑> bool
val (<=) : t ‑> t ‑> bool
val (<) : t ‑> t ‑> bool
\ No newline at end of file diff --git a/2.3/containers/CCInt32/index.html b/2.3/containers/CCInt32/index.html new file mode 100644 index 00000000..3d50d879 --- /dev/null +++ b/2.3/containers/CCInt32/index.html @@ -0,0 +1,39 @@ + +CCInt32 (containers.CCInt32)

Module CCInt32

Int32

Helpers for 32-bit integers.

This module provides operations on the type int32 of signed 32-bit integers. +Unlike the built-in int type, the type int32 is guaranteed to be exactly +32-bit wide on all platforms. All arithmetic operations over int32 are taken +modulo 232.

Performance notice: values of type int32 occupy more memory space than values +of type int, and arithmetic operations on int32 are generally slower than +those on int. Use int32 only when the application requires exact 32-bit arithmetic.

include module type of sig ... end
val zero : int32
val one : int32
val minus_one : int32
external neg : int32 ‑> int32 = "%int32_neg"
external add : int32 ‑> int32 ‑> int32 = "%int32_add"
external sub : int32 ‑> int32 ‑> int32 = "%int32_sub"
external mul : int32 ‑> int32 ‑> int32 = "%int32_mul"
external div : int32 ‑> int32 ‑> int32 = "%int32_div"
external rem : int32 ‑> int32 ‑> int32 = "%int32_mod"
val succ : int32 ‑> int32
val pred : int32 ‑> int32
val abs : int32 ‑> int32
val max_int : int32
val min_int : int32
external logand : int32 ‑> int32 ‑> int32 = "%int32_and"
external logor : int32 ‑> int32 ‑> int32 = "%int32_or"
external logxor : int32 ‑> int32 ‑> int32 = "%int32_xor"
val lognot : int32 ‑> int32
external shift_left : int32 ‑> int ‑> int32 = "%int32_lsl"
external shift_right : int32 ‑> int ‑> int32 = "%int32_asr"
external shift_right_logical : int32 ‑> int ‑> int32 = "%int32_lsr"
external of_int : int ‑> int32 = "%int32_of_int"
external to_int : int32 ‑> int = "%int32_to_int"
external of_float : float ‑> int32 = "caml_int32_of_float" "caml_int32_of_float_unboxed"
external to_float : int32 ‑> float = "caml_int32_to_float" "caml_int32_to_float_unboxed"
external of_string : string ‑> int32 = "caml_int32_of_string"
val of_string_opt : string ‑> int32 option
val to_string : int32 ‑> string
external bits_of_float : float ‑> int32 = "caml_int32_bits_of_float" "caml_int32_bits_of_float_unboxed"
external float_of_bits : int32 ‑> float = "caml_int32_float_of_bits" "caml_int32_float_of_bits_unboxed"
type t = int32
val compare : t ‑> t ‑> int
val equal : t ‑> t ‑> bool
external format : string ‑> int32 ‑> string = "caml_int32_format"
val (+) : t ‑> t ‑> t

Addition.

val (-) : t ‑> t ‑> t

Subtraction.

val (~-) : t ‑> t

Unary negation.

val (*) : t ‑> t ‑> t

Multiplication.

val (/) : t ‑> t ‑> t

Integer division. Raise Division_by_zero if the second +argument is zero. This division rounds the real quotient of +its arguments towards zero, as specified for Pervasives.(/).

val (mod) : t ‑> t ‑> t

x mod y is the integer remainder. +If y <> zero, the result of x mod y satisfies the following property: +x = ((x / y) * y) + (x mod y). +If y = 0, x mod y raises Division_by_zero.

val (land) : t ‑> t ‑> t

Bitwise logical and.

val (lor) : t ‑> t ‑> t

Bitwise logical or.

val (lxor) : t ‑> t ‑> t

Bitwise logical exclusive or.

val (lnot) : t ‑> t

Bitwise logical negation.

val (lsl) : t ‑> int ‑> t

x lsl y shifts x to the left by y bits, filling in with zeroes. +The result is unspecified if y < 0 or y >= 32.

val (lsr) : t ‑> int ‑> t

x lsr y shifts x to the right by y bits. +This is a logical shift: zeroes are inserted in the vacated bits +regardless of the sign of x. +The result is unspecified if y < 0 or y >= 32.

val (asr) : t ‑> int ‑> t

x asr y shifts x to the right by y bits. +This is an arithmetic shift: the sign bit of x is replicated +and inserted in the vacated bits. +The result is unspecified if y < 0 or y >= 32.

module Infix : sig ... end
include module type of Infix
val (+) : t ‑> t ‑> t
val (-) : t ‑> t ‑> t
val (~-) : t ‑> t
val (*) : t ‑> t ‑> t
val (/) : t ‑> t ‑> t
val (mod) : t ‑> t ‑> t
val (land) : t ‑> t ‑> t
val (lor) : t ‑> t ‑> t
val (lxor) : t ‑> t ‑> t
val (lnot) : t ‑> t
val (lsl) : t ‑> int ‑> t
val (lsr) : t ‑> int ‑> t
val (asr) : t ‑> int ‑> t
val (=) : t ‑> t ‑> bool
val (<>) : t ‑> t ‑> bool
val (>) : t ‑> t ‑> bool
val (>=) : t ‑> t ‑> bool
val (<=) : t ‑> t ‑> bool
val (<) : t ‑> t ‑> bool
val equal : t ‑> t ‑> bool

The equal function for 32-bit integers. +Like Pervasives.(=) x y).

val hash : t ‑> int

Like Pervasives.abs (to_int x).

Conversion

val to_int : t ‑> int

Convert the given 32-bit integer (type int32) to an +integer (type int). On 32-bit platforms, the 32-bit integer +is taken modulo 231, i.e. the high-order bit is lost +during the conversion. On 64-bit platforms, the conversion is exact.

val of_int : int ‑> t

Alias to Int32.of_int.

val to_float : t ‑> float

Convert the given 32-bit integer to a floating-point number.

val of_float : float ‑> t

Alias to Int32.of_float. +Convert the given floating-point number to a 32-bit integer, +discarding the fractional part (truncate towards 0). +The result of the conversion is undefined if, after truncation, the number +is outside the range [CCInt32.min_int, CCInt32.max_int].

val to_string : t ‑> string

Return the string representation of its argument, in signed decimal.

val of_string_exn : string ‑> t

Alias to Int32.of_string. +Convert the given string to a 32-bit integer. +The string is read in decimal (by default, or if the string +begins with 0u) or in hexadecimal, octal or binary if the +string begins with 0x, 0o or 0b respectively.

The 0u prefix reads the input as an unsigned integer in the range +[0, 2*CCInt32.max_int+1]. If the input exceeds CCInt32.max_int +it is converted to the signed integer +CCInt32.min_int + input - CCInt32.max_int - 1.

The _ (underscore) character can appear anywhere in the string +and is ignored. +Raise Failure "Int32.of_string" if the given string is not +a valid representation of an integer, or if the integer represented +exceeds the range of integers representable in type int32.

val of_string : string ‑> t option

Safe version of of_string_exn. +Like of_string_exn, but return None instead of raising.

val of_string_opt : string ‑> t option

Alias to of_string.

\ No newline at end of file diff --git a/2.3/containers/CCInt64/.jbuilder-keep b/2.3/containers/CCInt64/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCInt64/Infix/index.html b/2.3/containers/CCInt64/Infix/index.html new file mode 100644 index 00000000..f50f1a50 --- /dev/null +++ b/2.3/containers/CCInt64/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCInt64.Infix)

Module CCInt64.Infix

Infix operators

val (+) : t ‑> t ‑> t
val (-) : t ‑> t ‑> t
val (~-) : t ‑> t
val (*) : t ‑> t ‑> t
val (/) : t ‑> t ‑> t
val (mod) : t ‑> t ‑> t
val (land) : t ‑> t ‑> t
val (lor) : t ‑> t ‑> t
val (lxor) : t ‑> t ‑> t
val (lnot) : t ‑> t
val (lsl) : t ‑> int ‑> t
val (lsr) : t ‑> int ‑> t
val (asr) : t ‑> int ‑> t
val (=) : t ‑> t ‑> bool
val (<>) : t ‑> t ‑> bool
val (>) : t ‑> t ‑> bool
val (>=) : t ‑> t ‑> bool
val (<=) : t ‑> t ‑> bool
val (<) : t ‑> t ‑> bool
\ No newline at end of file diff --git a/2.3/containers/CCInt64/index.html b/2.3/containers/CCInt64/index.html new file mode 100644 index 00000000..6d1f62bb --- /dev/null +++ b/2.3/containers/CCInt64/index.html @@ -0,0 +1,46 @@ + +CCInt64 (containers.CCInt64)

Module CCInt64

Int64

Helpers for 64-bit integers

include module type of sig ... end
val zero : int64
val one : int64
val minus_one : int64
external neg : int64 ‑> int64 = "%int64_neg"
external add : int64 ‑> int64 ‑> int64 = "%int64_add"
external sub : int64 ‑> int64 ‑> int64 = "%int64_sub"
external mul : int64 ‑> int64 ‑> int64 = "%int64_mul"
external div : int64 ‑> int64 ‑> int64 = "%int64_div"
external rem : int64 ‑> int64 ‑> int64 = "%int64_mod"
val succ : int64 ‑> int64
val pred : int64 ‑> int64
val abs : int64 ‑> int64
val max_int : int64
val min_int : int64
external logand : int64 ‑> int64 ‑> int64 = "%int64_and"
external logor : int64 ‑> int64 ‑> int64 = "%int64_or"
external logxor : int64 ‑> int64 ‑> int64 = "%int64_xor"
val lognot : int64 ‑> int64
external shift_left : int64 ‑> int ‑> int64 = "%int64_lsl"
external shift_right : int64 ‑> int ‑> int64 = "%int64_asr"
external shift_right_logical : int64 ‑> int ‑> int64 = "%int64_lsr"
external of_int : int ‑> int64 = "%int64_of_int"
external to_int : int64 ‑> int = "%int64_to_int"
external of_float : float ‑> int64 = "caml_int64_of_float" "caml_int64_of_float_unboxed"
external to_float : int64 ‑> float = "caml_int64_to_float" "caml_int64_to_float_unboxed"
external of_int32 : int32 ‑> int64 = "%int64_of_int32"
external to_int32 : int64 ‑> int32 = "%int64_to_int32"
external of_nativeint : nativeint ‑> int64 = "%int64_of_nativeint"
external to_nativeint : int64 ‑> nativeint = "%int64_to_nativeint"
external of_string : string ‑> int64 = "caml_int64_of_string"
val of_string_opt : string ‑> int64 option
val to_string : int64 ‑> string
external bits_of_float : float ‑> int64 = "caml_int64_bits_of_float" "caml_int64_bits_of_float_unboxed"
external float_of_bits : int64 ‑> float = "caml_int64_float_of_bits" "caml_int64_float_of_bits_unboxed"
type t = int64
val compare : t ‑> t ‑> int
val equal : t ‑> t ‑> bool
external format : string ‑> int64 ‑> string = "caml_int64_format"
val (+) : t ‑> t ‑> t

Addition.

val (-) : t ‑> t ‑> t

Subtraction.

val (~-) : t ‑> t

Unary negation.

val (*) : t ‑> t ‑> t

Multiplication.

val (/) : t ‑> t ‑> t

Integer division. Raise Division_by_zero if the second +argument is zero. This division rounds the real quotient of +its arguments towards zero, as specified for Pervasives.(/).

val (mod) : t ‑> t ‑> t

Integer remainder. +If y = 0, x mod y raises Division_by_zero.

val abs : t ‑> t

Return the absolute value of its argument.

val max_int : t

The greatest representable 64-bit integer, 263 - 1 = 9_223_372_036_854_775_807.

val min_int : t

The smallest representable 64-bit integer, -263 = -9_223_372_036_854_775_808.

val (land) : t ‑> t ‑> t

Bitwise logical and.

val (lor) : t ‑> t ‑> t

Bitwise logical or.

val (lxor) : t ‑> t ‑> t

Bitwise logical exclusive or.

val (lnot) : t ‑> t

Bitwise logical negation.

val (lsl) : t ‑> int ‑> t

x lsl y shifts x to the left by y bits, filling in with zeroes. +The result is unspecified if y < 0 or y >= 64.

val (lsr) : t ‑> int ‑> t

x lsr y shifts x to the right by y bits. +This is a logical shift: zeroes are inserted in the vacated bits +regardless of the sign of x. +The result is unspecified if y < 0 or y >= 64.

val (asr) : t ‑> int ‑> t

x asr y shifts x to the right by y bits. +This is an arithmetic shift: the sign bit of x is replicated +and inserted in the vacated bits. +The result is unspecified if y < 0 or y >= 64.

module Infix : sig ... end

Infix operators

include module type of Infix

Infix operators

  • Since: 2.1
val (+) : t ‑> t ‑> t
val (-) : t ‑> t ‑> t
val (~-) : t ‑> t
val (*) : t ‑> t ‑> t
val (/) : t ‑> t ‑> t
val (mod) : t ‑> t ‑> t
val (land) : t ‑> t ‑> t
val (lor) : t ‑> t ‑> t
val (lxor) : t ‑> t ‑> t
val (lnot) : t ‑> t
val (lsl) : t ‑> int ‑> t
val (lsr) : t ‑> int ‑> t
val (asr) : t ‑> int ‑> t
val (=) : t ‑> t ‑> bool
val (<>) : t ‑> t ‑> bool
val (>) : t ‑> t ‑> bool
val (>=) : t ‑> t ‑> bool
val (<=) : t ‑> t ‑> bool
val (<) : t ‑> t ‑> bool
val equal : t ‑> t ‑> bool

The equal function for 64-bit integers. +Like Pervasives.(=) x y).

val compare : t ‑> t ‑> int

The comparison function for 64-bit integers, with the same specification as +Pervasives.compare. Along with the type t, this function compare +allows the module CCInt64 to be passed as argument to the functors +Set.Make and Map.Make.

val hash : t ‑> int

Like Pervasives.abs (to_int x).

Conversion

val to_int : t ‑> int

Convert the given 64-bit integer (type int64) to an +integer (type int). On 64-bit platforms, the 64-bit integer +is taken modulo 263, i.e. the high-order bit is lost +during the conversion. On 32-bit platforms, the 64-bit integer +is taken modulo 231, i.e. the top 33 bits are lost +during the conversion.

val of_int : int ‑> t

Alias to Int64.of_int. +NOTE: used to return an option, but the function actually never fails.

val of_int_exn : int ‑> t

Alias to Int64.of_int.

  • Deprecated since 2.1, use Int64.of_int instead.
val to_int32 : t ‑> int32

Convert the given 64-bit integer (type int64) to a +32-bit integer (type int32). The 64-bit integer +is taken modulo 232, i.e. the top 32 bits are lost +during the conversion.

val of_int32 : int32 ‑> t

Alias to Int64.of_int32. +NOTE: use to return an option, but the function actually never fails.

val of_int32_exn : int32 ‑> t

Alias to Int64.of_int32.

  • Deprecated since 2.1, use Int64.of_int32 instead.
val to_nativeint : t ‑> nativeint

Convert the given 64-bit integer (type int64) to a +native integer. On 32-bit platforms, the 64-bit integer +is taken modulo 232. On 64-bit platforms, +the conversion is exact.

val of_nativeint : nativeint ‑> t

Alias to Int64.of_nativeint. +NOTE: use to return an option, but the function actually never fails.

val of_nativeint_exn : nativeint ‑> t

Alias to Int64.of_nativeint.

  • Deprecated since 2.1, use Int64.of_nativeint instead.
val to_float : t ‑> float

Convert the given 64-bit integer to a floating-point number.

val of_float : float ‑> t

Alias to Int64.of_float. +Convert the given floating-point number to a 64-bit integer, +discarding the fractional part (truncate towards 0). +The result of the conversion is undefined if, after truncation, +the number is outside the range [CCInt64.min_int, CCInt64.max_int]. +NOTE: used to return an option, but the function never fails.

val of_float_exn : float ‑> t

Alias to Int64.of_float.

  • Deprecated since 2.1, use Int64.of_float instead.
val to_string : t ‑> string

Return the string representation of its argument, in decimal.

val of_string : string ‑> t option

Safe version of of_string_exn.

val of_string_opt : string ‑> t option

Alias to of_string.

  • Since: 2.1
val of_string_exn : string ‑> t

Alias to Int64.of_string. +Convert the given string to a 64-bit integer. +The string is read in decimal (by default, or if the string +begins with 0u) or in hexadecimal, octal or binary if the +string begins with 0x, 0o or 0b respectively.

The 0u prefix reads the input as an unsigned integer in the range +[0, 2*CCInt64.max_int+1]. If the input exceeds CCInt64.max_int +it is converted to the signed integer +CCInt64.min_int + input - CCInt64.max_int - 1.

The _ (underscore) character can appear anywhere in the string +and is ignored. +Raise Failure "Int64.of_string" if the given string is not +a valid representation of an integer, or if the integer represented +exceeds the range of integers representable in type int64.

\ No newline at end of file diff --git a/2.3/containers/CCIntMap/.jbuilder-keep b/2.3/containers/CCIntMap/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCIntMap/index.html b/2.3/containers/CCIntMap/index.html new file mode 100644 index 00000000..18c27b44 --- /dev/null +++ b/2.3/containers/CCIntMap/index.html @@ -0,0 +1,6 @@ + +CCIntMap (containers.CCIntMap)

Module CCIntMap

Map specialized for Int keys

status: stable

type +'a t
val empty : 'a t
val is_empty : _ t ‑> bool

Is the map empty?

  • Since: 2.3
val singleton : int ‑> 'a ‑> 'a t
val doubleton : int ‑> 'a ‑> int ‑> 'a ‑> 'a t
val mem : int ‑> _ t ‑> bool
val find : int ‑> 'a t ‑> 'a option
val find_exn : int ‑> 'a t ‑> 'a

Same as find but unsafe.

  • Raises Not_found: if key is not present.
val add : int ‑> 'a ‑> 'a t ‑> 'a t
val remove : int ‑> 'a t ‑> 'a t
val equal : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool

equal ~eq a b checks whether a and b have the same set of pairs +(key, value), comparing values with eq.

  • Since: 0.13
val compare : cmp:('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a t ‑> int

Total order between maps; the precise order is unspecified.

  • Since: 0.13
val update : int ‑> ('a option ‑> 'a option) ‑> 'a t ‑> 'a t
val filter : (int ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t

Filter values using the given predicate

  • Since: 2.3
val filter_map : (int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b t

Filter-map values using the given function

  • Since: 2.3
val cardinal : _ t ‑> int

Number of bindings in the map. Linear time.

val iter : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val fold : (int ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
val mapi : (int ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t
  • Since: 0.17
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t
  • Since: 0.17
val choose : 'a t ‑> (int * 'a) option
val choose_exn : 'a t ‑> int * 'a
  • Raises Not_found: if not pair was found.
val union : (int ‑> 'a ‑> 'a ‑> 'a) ‑> 'a t ‑> 'a t ‑> 'a t
val inter : (int ‑> 'a ‑> 'a ‑> 'a) ‑> 'a t ‑> 'a t ‑> 'a t
val merge : f:(int ‑> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

merge ~f m1 m2 merges m1 and m2 together, calling f once on every +key that occurs in at least one of m1 and m2. +if f k binding = Some c then k -> c is part of the result, +else k is not part of the result.

  • Since: 2.3

Whole-collection operations

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
val add_list : 'a t ‑> (int * 'a) list ‑> 'a t
val of_list : (int * 'a) list ‑> 'a t
val to_list : 'a t ‑> (int * 'a) list
val add_seq : 'a t ‑> (int * 'a) sequence ‑> 'a t
val of_seq : (int * 'a) sequence ‑> 'a t
val to_seq : 'a t ‑> (int * 'a) sequence
val keys : _ t ‑> int sequence
val values : 'a t ‑> 'a sequence
val add_gen : 'a t ‑> (int * 'a) gen ‑> 'a t
  • Since: 0.13
val of_gen : (int * 'a) gen ‑> 'a t
  • Since: 0.13
val to_gen : 'a t ‑> (int * 'a) gen
  • Since: 0.13
val add_klist : 'a t ‑> (int * 'a) klist ‑> 'a t
  • Since: 0.13
val of_klist : (int * 'a) klist ‑> 'a t
  • Since: 0.13
val to_klist : 'a t ‑> (int * 'a) klist
  • Since: 0.13
type 'a tree = unit ‑> [ `Nil | `Node of 'a * 'a tree list ]
val as_tree : 'a t ‑> [ `Node of int * int | `Leaf of int * 'a ] tree

IO

type 'a printer = Format.formatter ‑> 'a ‑> unit
val pp : 'a printer ‑> 'a t printer
  • Since: 0.13

Helpers

\ No newline at end of file diff --git a/2.3/containers/CCKList/.jbuilder-keep b/2.3/containers/CCKList/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCKList/Infix/index.html b/2.3/containers/CCKList/Infix/index.html new file mode 100644 index 00000000..3119fd8a --- /dev/null +++ b/2.3/containers/CCKList/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCKList.Infix)

Module CCKList.Infix

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t
val (>>-) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
val (<.>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t
val (--) : int ‑> int ‑> int t
val (--^) : int ‑> int ‑> int t
\ No newline at end of file diff --git a/2.3/containers/CCKList/Traverse/argument-1-M/index.html b/2.3/containers/CCKList/Traverse/argument-1-M/index.html new file mode 100644 index 00000000..0d5db06e --- /dev/null +++ b/2.3/containers/CCKList/Traverse/argument-1-M/index.html @@ -0,0 +1,2 @@ + +1-M (containers.CCKList.Traverse.1-M)

Parameter CCKList.Traverse.1-M

type 'a t
val return : 'a ‑> 'a t
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
\ No newline at end of file diff --git a/2.3/containers/CCKList/Traverse/index.html b/2.3/containers/CCKList/Traverse/index.html new file mode 100644 index 00000000..5b23ac7b --- /dev/null +++ b/2.3/containers/CCKList/Traverse/index.html @@ -0,0 +1,2 @@ + +Traverse (containers.CCKList.Traverse)

Module CCKList.Traverse

Parameters

Signature

val sequence_m : 'a M.t t ‑> 'a t M.t
val fold_m : ('b ‑> 'a ‑> 'b M.t) ‑> 'b ‑> 'a t ‑> 'b M.t
val map_m : ('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t
\ No newline at end of file diff --git a/2.3/containers/CCKList/index.html b/2.3/containers/CCKList/index.html new file mode 100644 index 00000000..9258571b --- /dev/null +++ b/2.3/containers/CCKList/index.html @@ -0,0 +1,16 @@ + +CCKList (containers.CCKList)

Module CCKList

Continuation List

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
type 'a equal = 'a ‑> 'a ‑> bool
type 'a ord = 'a ‑> 'a ‑> int
type 'a printer = Format.formatter ‑> 'a ‑> unit

Basics

type +'a t = unit ‑> [ `Nil | `Cons of 'a * 'a t ]
val nil : 'a t
val empty : 'a t
val cons : 'a ‑> 'a t ‑> 'a t
val singleton : 'a ‑> 'a t
val repeat : ?⁠n:int ‑> 'a ‑> 'a t

repeat ~n x repeats xn times then stops. If n is omitted, +then x is repeated forever.

  • Since: 0.3.3
val cycle : 'a t ‑> 'a t

Cycle through the iterator infinitely. The iterator shouldn't be empty.

  • Since: 0.3.3
val unfold : ('b ‑> ('a * 'b) option) ‑> 'b ‑> 'a t

unfold f acc calls f acc and: +

  • if f acc = Some (x, acc'), yield x, continue with unfold f acc'.
  • if f acc = None, stops.
  • Since: 0.13
val is_empty : 'a t ‑> bool
val head : 'a t ‑> 'a option

Head of the list.

  • Since: 0.13
val head_exn : 'a t ‑> 'a

Unsafe version of head.

  • Raises Not_found: if the list is empty.
  • Since: 0.13
val tail : 'a t ‑> 'a t option

Tail of the list.

  • Since: 0.13
val tail_exn : 'a t ‑> 'a t

Unsafe version of tail.

  • Raises Not_found: if the list is empty.
  • Since: 0.13
val equal : 'a equal ‑> 'a t equal

Equality step by step. Eager.

val compare : 'a ord ‑> 'a t ord

Lexicographic comparison. Eager.

val fold : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a

Fold on values.

val iter : ('a ‑> unit) ‑> 'a t ‑> unit
val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Iterate with index (starts at 0).

  • Since: 0.13
val length : _ t ‑> int

Number of elements in the list. +Will not terminate if the list if infinite: +use (for instance) take to make the list finite if necessary.

val take : int ‑> 'a t ‑> 'a t
val take_while : ('a ‑> bool) ‑> 'a t ‑> 'a t
val drop : int ‑> 'a t ‑> 'a t
val drop_while : ('a ‑> bool) ‑> 'a t ‑> 'a t
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t
val mapi : (int ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Map with index (starts at 0).

  • Since: 0.13
val fmap : ('a ‑> 'b option) ‑> 'a t ‑> 'b t
val filter : ('a ‑> bool) ‑> 'a t ‑> 'a t
val append : 'a t ‑> 'a t ‑> 'a t
val product_with : ('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t

Fair product of two (possibly infinite) lists into a new list. Lazy. +The first parameter is used to combine each pair of elements.

  • Since: 0.3.3
val product : 'a t ‑> 'b t ‑> ('a * 'b) t

Specialization of product_with producing tuples.

  • Since: 0.3.3
val group : 'a equal ‑> 'a t ‑> 'a t t

group eq l groups together consecutive elements that satisfy eq. Lazy. +For instance group (=) [1;1;1;2;2;3;3;1] yields +[1;1;1]; [2;2]; [3;3]; [1].

  • Since: 0.3.3
val uniq : 'a equal ‑> 'a t ‑> 'a t

uniq eq l returns l but removes consecutive duplicates. Lazy. +In other words, if several values that are equal follow one another, +only the first of them is kept.

  • Since: 0.3.3
val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b t
val filter_map : ('a ‑> 'b option) ‑> 'a t ‑> 'b t
val flatten : 'a t t ‑> 'a t
val range : int ‑> int ‑> int t
val (--) : int ‑> int ‑> int t

a -- b is the range of integers containing +a and b (therefore, never empty).

val (--^) : int ‑> int ‑> int t

a -- b is the integer range from a to b, where b is excluded.

  • Since: 0.17

Operations on two Collections

val fold2 : ('acc ‑> 'a ‑> 'b ‑> 'acc) ‑> 'acc ‑> 'a t ‑> 'b t ‑> 'acc

Fold on two collections at once. Stop at soon as one of them ends.

val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t

Map on two collections at once. Stop as soon as one of the +arguments is exhausted.

val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit

Iterate on two collections at once. Stop as soon as one of them ends.

val for_all2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool
val exists2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool
val merge : 'a ord ‑> 'a t ‑> 'a t ‑> 'a t

Merge two sorted iterators into a sorted iterator.

val zip : 'a t ‑> 'b t ‑> ('a * 'b) t

Combine elements pairwise. Stop as soon as one of the lists stops.

  • Since: 0.13
val unzip : ('a * 'b) t ‑> 'a t * 'b t

Split each tuple in the list.

  • Since: 0.13

Misc

val sort : cmp:'a ord ‑> 'a t ‑> 'a t

Eager sort. Require the iterator to be finite. O(n ln(n)) time +and space.

  • Since: 0.3.3
val sort_uniq : cmp:'a ord ‑> 'a t ‑> 'a t

Eager sort that removes duplicate values. Require the iterator to be +finite. O(n ln(n)) time and space.

  • Since: 0.3.3
val memoize : 'a t ‑> 'a t

Avoid recomputations by caching intermediate results.

  • Since: 0.14

Fair Combinations

val interleave : 'a t ‑> 'a t ‑> 'a t

Fair interleaving of both streams.

  • Since: 0.13
val fair_flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b t

Fair version of flat_map.

  • Since: 0.13
val fair_app : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

Fair version of (<*>).

  • Since: 0.13

Implementations

val return : 'a ‑> 'a t
val pure : 'a ‑> 'a t
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t
val (>>-) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Infix version of fair_flat_map.

  • Since: 0.13
val (<.>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

Infix version of fair_app.

  • Since: 0.13

Infix operators

module Infix : sig ... end
module type MONAD : sig ... end

Monadic Operations

module Traverse : functor (M : MONAD) -> sig ... end

Conversions

val of_list : 'a list ‑> 'a t
val to_list : 'a t ‑> 'a list

Gather all values into a list.

val of_array : 'a array ‑> 'a t

Iterate on the array.

  • Since: 0.13
val to_array : 'a t ‑> 'a array

Convert into array. Iterate twice.

  • Since: 0.13
val to_rev_list : 'a t ‑> 'a list

Convert to a list, in reverse order. More efficient than to_list.

val to_seq : 'a t ‑> 'a sequence
val to_gen : 'a t ‑> 'a gen
val of_gen : 'a gen ‑> 'a t

of_gen g consumes the generator and caches intermediate results.

  • Since: 0.13

IO

val pp : ?⁠sep:string ‑> 'a printer ‑> 'a t printer

Print the list with the given separator (default ","). +Do not print opening/closing delimiters.

\ No newline at end of file diff --git a/2.3/containers/CCKList/module-type-MONAD/index.html b/2.3/containers/CCKList/module-type-MONAD/index.html new file mode 100644 index 00000000..06109184 --- /dev/null +++ b/2.3/containers/CCKList/module-type-MONAD/index.html @@ -0,0 +1,2 @@ + +MONAD (containers.CCKList.MONAD)

Module type CCKList.MONAD

Monadic Operations

type 'a t
val return : 'a ‑> 'a t
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
\ No newline at end of file diff --git a/2.3/containers/CCKTree/.jbuilder-keep b/2.3/containers/CCKTree/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCKTree/Dot/index.html b/2.3/containers/CCKTree/Dot/index.html new file mode 100644 index 00000000..c9215594 --- /dev/null +++ b/2.3/containers/CCKTree/Dot/index.html @@ -0,0 +1,4 @@ + +Dot (containers.CCKTree.Dot)

Module CCKTree.Dot

type attribute = [
| `Color of string
| `Shape of string
| `Weight of int
| `Style of string
| `Label of string
| `Id of string
| `Other of string * string
]

Dot attributes for nodes

type graph = string * attribute list t list

A dot graph is a name, plus a list of trees labelled with attributes

val mk_id : ('a, Buffer.t, unit, attribute) Pervasives.format4 ‑> 'a

Using a formatter string, build an ID.

val mk_label : ('a, Buffer.t, unit, attribute) Pervasives.format4 ‑> 'a

Using a formatter string, build a label.

val make : name:string ‑> attribute list t list ‑> graph
val singleton : name:string ‑> attribute list t ‑> graph
val pp_single : string ‑> attribute list t printer
val pp : graph printer

Printer to DOT with indentation, etc.

  • Since: 0.6.1
val print_to_file : string ‑> graph ‑> unit

print_to_file filename g prints g into a file whose name +is filename.

  • Since: 0.6.1
val to_file : ?⁠name:string ‑> string ‑> attribute list t list ‑> unit

to_file filename trees makes a graph out of the trees, opens the +file filename and prints the graph into the file.

  • Parameter name: name of the graph.
  • Since: 0.6.1
\ No newline at end of file diff --git a/2.3/containers/CCKTree/class-type-pset/index.html b/2.3/containers/CCKTree/class-type-pset/index.html new file mode 100644 index 00000000..87e90727 --- /dev/null +++ b/2.3/containers/CCKTree/class-type-pset/index.html @@ -0,0 +1,2 @@ + +pset (containers.CCKTree.pset)

Class type CCKTree.pset

Abstract Set structure

method add : 'a ‑> 'a pset
method mem : 'a ‑> bool
\ No newline at end of file diff --git a/2.3/containers/CCKTree/index.html b/2.3/containers/CCKTree/index.html new file mode 100644 index 00000000..53498020 --- /dev/null +++ b/2.3/containers/CCKTree/index.html @@ -0,0 +1,22 @@ + +CCKTree (containers.CCKTree)

Module CCKTree

Lazy Tree Structure

+This structure can be used to represent trees and directed +graphs (as infinite trees) in a lazy fashion. Like CCKList, it +is a structural type.

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a printer = Format.formatter ‑> 'a ‑> unit

Basics

type +'a t = unit ‑> [ `Nil | `Node of 'a * 'a t list ]
val empty : 'a t
val is_empty : _ t ‑> bool
val singleton : 'a ‑> 'a t

Tree with only one label.

val node : 'a ‑> 'a t list ‑> 'a t

Build a node from a label and a list of children.

val node1 : 'a ‑> 'a t ‑> 'a t

Node with one child.

val node2 : 'a ‑> 'a t ‑> 'a t ‑> 'a t

Node with two children.

val fold : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a

Fold on values in no specified order. May not terminate if the +tree is infinite.

val iter : ('a ‑> unit) ‑> 'a t ‑> unit
val size : _ t ‑> int

Number of elements.

val height : _ t ‑> int

Length of the longest path to empty leaves.

val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
val cut_depth : int ‑> 'a t ‑> 'a t

Cut the tree at the given depth, so it becomes finite.

Graph Traversals

class type 'a pset = object ... end

Abstract Set structure

val set_of_cmp : cmp:('a ‑> 'a ‑> int) ‑> unit ‑> 'a pset

Build a set structure given a total ordering.

val dfs : pset:'a pset ‑> 'a t ‑> [ `Enter of 'a | `Exit of 'a ] klist

Depth-first traversal of the tree.

val bfs : pset:'a pset ‑> 'a t ‑> 'a klist

Breadth-first traversal of the tree.

val force : 'a t ‑> [ `Nil | `Node of 'a * 'b list ] as b

force t evaluates t completely and returns a regular tree +structure.

  • Since: 0.13
val find : pset:'a pset ‑> ('a ‑> 'b option) ‑> 'a t ‑> 'b option

Look for an element that maps to Some _.

Pretty-printing

Example (tree of calls for naive Fibonacci function): +

      let mk_fib n =
+        let rec fib' l r i =
+          if i=n then r else fib' r (l+r) (i+1)
+        in fib' 1 1 1;;
+
+      let rec fib n = match n with
+        | 0 | 1 -> CCKTree.singleton (`Cst n)
+        | _ -> CCKTree.node2 (`Plus (mk_fib n)) (fib (n-1)) (fib (n-2));;
+
+      let pp_node fmt = function
+        | `Cst n -> Format.fprintf fmt "%d" n
+        | `Plus n -> Format.fprintf fmt "%d" n;;
+
+      Format.printf "%a@." (CCKTree.pp pp_node) (fib 8);;
val pp : 'a printer ‑> 'a t printer

A pretty-printer using S-expressions and boxes to render the tree. +Empty nodes are not rendered; sharing is ignored.

  • Since: 0.9

Pretty printing in the DOT (graphviz) format

module Dot : sig ... end
\ No newline at end of file diff --git a/2.3/containers/CCLazy_list/.jbuilder-keep b/2.3/containers/CCLazy_list/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCLazy_list/Infix/index.html b/2.3/containers/CCLazy_list/Infix/index.html new file mode 100644 index 00000000..efff6005 --- /dev/null +++ b/2.3/containers/CCLazy_list/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCLazy_list.Infix)

Module CCLazy_list.Infix

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
val (<|>) : 'a t ‑> 'a t ‑> 'a t

Alias to default.

  • Since: 2.1
\ No newline at end of file diff --git a/2.3/containers/CCLazy_list/index.html b/2.3/containers/CCLazy_list/index.html new file mode 100644 index 00000000..0bfecea8 --- /dev/null +++ b/2.3/containers/CCLazy_list/index.html @@ -0,0 +1,3 @@ + +CCLazy_list (containers.CCLazy_list)

Module CCLazy_list

Lazy List

type +'a t = 'a node lazy_t
type +'a node =
| Nil
| Cons of 'a * 'a t
val empty : 'a t

Empty list.

val return : 'a ‑> 'a t

Return a computed value.

val is_empty : _ t ‑> bool

Evaluate the head.

val length : _ t ‑> int

length l returns the number of elements in l, eagerly (linear time). +Caution, will not terminate if l is infinite.

val cons : 'a ‑> 'a t ‑> 'a t
val head : 'a t ‑> ('a * 'a t) option

Evaluate head, return it, or None if the list is empty.

val map : f:('a ‑> 'b) ‑> 'a t ‑> 'b t

Lazy map.

val filter : f:('a ‑> bool) ‑> 'a t ‑> 'a t

Filter values.

  • Since: 0.18
val take : int ‑> 'a t ‑> 'a t

Take at most n values.

  • Since: 0.18
val append : 'a t ‑> 'a t ‑> 'a t

Lazy concatenation.

val flat_map : f:('a ‑> 'b t) ‑> 'a t ‑> 'b t

Monadic flatten + map.

val default : default:'a t ‑> 'a t ‑> 'a t

Choice operator.

  • Since: 2.1
module Infix : sig ... end
include module type of Infix
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
val (<|>) : 'a t ‑> 'a t ‑> 'a t

Alias to default.

  • Since: 2.1
type 'a gen = unit ‑> 'a option
val of_gen : 'a gen ‑> 'a t
val of_list : 'a list ‑> 'a t
val to_list : 'a t ‑> 'a list
val to_list_rev : 'a t ‑> 'a list
val to_gen : 'a t ‑> 'a gen
\ No newline at end of file diff --git a/2.3/containers/CCList/.jbuilder-keep b/2.3/containers/CCList/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCList/Assoc/index.html b/2.3/containers/CCList/Assoc/index.html new file mode 100644 index 00000000..7c33af60 --- /dev/null +++ b/2.3/containers/CCList/Assoc/index.html @@ -0,0 +1,4 @@ + +Assoc (containers.CCList.Assoc)

Module CCList.Assoc

type ('a, 'b) t = ('a * 'b) list
val get : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> 'b option

Find the element.

val get_exn : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> 'b

Like get, but unsafe.

  • Raises Not_found: if the element is not present.
val set : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> 'b ‑> ('a'bt ‑> ('a'bt

Add the binding into the list (erase it if already present).

val mem : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a_t ‑> bool

mem x l returns true iff x is a key in l.

  • Since: 0.16
val update : eq:('a ‑> 'a ‑> bool) ‑> f:('b option ‑> 'b option) ‑> 'a ‑> ('a'bt ‑> ('a'bt

update k ~f l updates l on the key k, by calling f (get l k) +and removing k if it returns None, mapping k to v' if it +returns Some v'.

  • Since: 0.16
val remove : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> ('a'bt

remove x l removes the first occurrence of k from l.

  • Since: 0.17
\ No newline at end of file diff --git a/2.3/containers/CCList/Infix/index.html b/2.3/containers/CCList/Infix/index.html new file mode 100644 index 00000000..a96c1c4e --- /dev/null +++ b/2.3/containers/CCList/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCList.Infix)

Module CCList.Infix

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map with reversed arguments.

val (@) : 'a t ‑> 'a t ‑> 'a t

As append. Concatenate two lists.

val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

funs <*> l is product (fun f x -> f x) funs l.

val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

As map.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

l >>= f is flat_map f l.

val (--) : int ‑> int ‑> int t

Infix alias for range. Bounds included.

val (--^) : int ‑> int ‑> int t

Infix alias for range'. Second bound excluded.

\ No newline at end of file diff --git a/2.3/containers/CCList/Ref/index.html b/2.3/containers/CCList/Ref/index.html new file mode 100644 index 00000000..56413548 --- /dev/null +++ b/2.3/containers/CCList/Ref/index.html @@ -0,0 +1,3 @@ + +Ref (containers.CCList.Ref)

Module CCList.Ref

type 'a t = 'a list Pervasives.ref
val push : 'a t ‑> 'a ‑> unit
val pop : 'a t ‑> 'a option
val pop_exn : 'a t ‑> 'a

Unsafe version of pop.

  • Raises Failure: if the list is empty.
val create : unit ‑> 'a t

Create a new list reference.

val clear : _ t ‑> unit

Remove all elements.

val lift : ('a list ‑> 'b) ‑> 'a t ‑> 'b

Apply a list function to the content.

val push_list : 'a t ‑> 'a list ‑> unit

Add elements of the list at the beginning of the list ref. Elements +at the end of the list will be at the beginning of the list ref.

\ No newline at end of file diff --git a/2.3/containers/CCList/Traverse/argument-1-M/index.html b/2.3/containers/CCList/Traverse/argument-1-M/index.html new file mode 100644 index 00000000..07caa0b7 --- /dev/null +++ b/2.3/containers/CCList/Traverse/argument-1-M/index.html @@ -0,0 +1,2 @@ + +1-M (containers.CCList.Traverse.1-M)

Parameter CCList.Traverse.1-M

type 'a t
val return : 'a ‑> 'a t

Monadic return.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind.

\ No newline at end of file diff --git a/2.3/containers/CCList/Traverse/index.html b/2.3/containers/CCList/Traverse/index.html new file mode 100644 index 00000000..5b32801a --- /dev/null +++ b/2.3/containers/CCList/Traverse/index.html @@ -0,0 +1,4 @@ + +Traverse (containers.CCList.Traverse)

Module CCList.Traverse

Parameters

Signature

val sequence_m : 'a M.t t ‑> 'a t M.t
val fold_m : ('b ‑> 'a ‑> 'b M.t) ‑> 'b ‑> 'a t ‑> 'b M.t
val map_m : ('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t
val map_m_par : ('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t

Like map_m but map_m_par f (x::l) evaluates f x and +f l "in parallel" before combining their result (for instance +in Lwt).

\ No newline at end of file diff --git a/2.3/containers/CCList/index.html b/2.3/containers/CCList/index.html new file mode 100644 index 00000000..e702de44 --- /dev/null +++ b/2.3/containers/CCList/index.html @@ -0,0 +1,117 @@ + +CCList (containers.CCList)

Module CCList

Complements to list

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a random_gen = Random.State.t ‑> 'a
include module type of List
val length : 'a list ‑> int
val compare_lengths : 'a list ‑> 'b list ‑> int
val compare_length_with : 'a list ‑> int ‑> int
val cons : 'a ‑> 'a list ‑> 'a list
val hd : 'a list ‑> 'a
val tl : 'a list ‑> 'a list
val nth : 'a list ‑> int ‑> 'a
val nth_opt : 'a list ‑> int ‑> 'a option
val rev : 'a list ‑> 'a list
val init : int ‑> (int ‑> 'a) ‑> 'a list
val append : 'a list ‑> 'a list ‑> 'a list
val rev_append : 'a list ‑> 'a list ‑> 'a list
val concat : 'a list list ‑> 'a list
val flatten : 'a list list ‑> 'a list
val iter : ('a ‑> unit) ‑> 'a list ‑> unit
val iteri : (int ‑> 'a ‑> unit) ‑> 'a list ‑> unit
val map : ('a ‑> 'b) ‑> 'a list ‑> 'b list
val mapi : (int ‑> 'a ‑> 'b) ‑> 'a list ‑> 'b list
val rev_map : ('a ‑> 'b) ‑> 'a list ‑> 'b list
val fold_left : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b list ‑> 'a
val fold_right : ('a ‑> 'b ‑> 'b) ‑> 'a list ‑> 'b ‑> 'b
val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a list ‑> 'b list ‑> unit
val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c list
val rev_map2 : ('a ‑> 'b ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c list
val fold_left2 : ('a ‑> 'b ‑> 'c ‑> 'a) ‑> 'a ‑> 'b list ‑> 'c list ‑> 'a
val fold_right2 : ('a ‑> 'b ‑> 'c ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c ‑> 'c
val for_all : ('a ‑> bool) ‑> 'a list ‑> bool
val exists : ('a ‑> bool) ‑> 'a list ‑> bool
val for_all2 : ('a ‑> 'b ‑> bool) ‑> 'a list ‑> 'b list ‑> bool
val exists2 : ('a ‑> 'b ‑> bool) ‑> 'a list ‑> 'b list ‑> bool
val mem : 'a ‑> 'a list ‑> bool
val memq : 'a ‑> 'a list ‑> bool
val find : ('a ‑> bool) ‑> 'a list ‑> 'a
val find_opt : ('a ‑> bool) ‑> 'a list ‑> 'a option
val filter : ('a ‑> bool) ‑> 'a list ‑> 'a list
val find_all : ('a ‑> bool) ‑> 'a list ‑> 'a list
val partition : ('a ‑> bool) ‑> 'a list ‑> 'a list * 'a list
val assoc : 'a ‑> ('a * 'b) list ‑> 'b
val assoc_opt : 'a ‑> ('a * 'b) list ‑> 'b option
val assq : 'a ‑> ('a * 'b) list ‑> 'b
val assq_opt : 'a ‑> ('a * 'b) list ‑> 'b option
val mem_assoc : 'a ‑> ('a * 'b) list ‑> bool
val mem_assq : 'a ‑> ('a * 'b) list ‑> bool
val remove_assoc : 'a ‑> ('a * 'b) list ‑> ('a * 'b) list
val remove_assq : 'a ‑> ('a * 'b) list ‑> ('a * 'b) list
val split : ('a * 'b) list ‑> 'a list * 'b list
val combine : 'a list ‑> 'b list ‑> ('a * 'b) list
val sort : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
val stable_sort : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
val fast_sort : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
val sort_uniq : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
val merge : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list
type 'a t = 'a list
val empty : 'a t

empty is [].

val is_empty : _ t ‑> bool

is_empty l returns true iff l = [].

  • Since: 0.11
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Safe version of List.map.

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map with reversed arguments.

  • Since: 0.5
val cons : 'a ‑> 'a t ‑> 'a t

cons x l is x::l.

  • Since: 0.12
val append : 'a t ‑> 'a t ‑> 'a t

Safe version of List.append. +Concatenate two lists.

val cons_maybe : 'a option ‑> 'a t ‑> 'a t

cons_maybe (Some x) l is x :: l. +cons_maybe None l is l.

  • Since: 0.13
val (@) : 'a t ‑> 'a t ‑> 'a t

Like append. +Concatenate two lists.

val filter : ('a ‑> bool) ‑> 'a t ‑> 'a t

Safe version of List.filter. +filter p l returns all the elements of the list l +that satisfy the predicate p. The order of the elements +in the input list is preserved.

val fold_right : ('a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b

Safe version of fold_right. +fold_right f [a1; ...; an] b is +f a1 (f a2 (... (f an b) ...)). Not tail-recursive.

val fold_while : ('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> 'a ‑> 'b t ‑> 'a

Fold until a stop condition via ('a, `Stop) is +indicated by the accumulator.

  • Since: 0.8
val fold_map : ('acc ‑> 'a ‑> 'acc * 'b) ‑> 'acc ‑> 'a list ‑> 'acc * 'b list

fold_map f acc l is a fold_left-like function, but it also maps the +list to another list.

  • Since: 0.14
val scan_left : ('acc ‑> 'a ‑> 'acc) ‑> 'acc ‑> 'a list ‑> 'acc list

scan_left f acc l returns the list [acc; f acc x0; f (f acc x0) x1; ...] +where x0, x1, etc. are the elements of l.

  • Since: 1.2
val fold_map2 : ('acc ‑> 'a ‑> 'b ‑> 'acc * 'c) ‑> 'acc ‑> 'a list ‑> 'b list ‑> 'acc * 'c list

fold_map2 is to fold_map what List.map2 is to List.map.

  • Raises Invalid_argument: if the lists do not have the same length.
  • Since: 0.16
val fold_filter_map : ('acc ‑> 'a ‑> 'acc * 'b option) ‑> 'acc ‑> 'a list ‑> 'acc * 'b list

fold_filter_map f acc l is a fold_left-like function, but also +generates a list of output in a way similar to filter_map.

  • Since: 0.17
val fold_flat_map : ('acc ‑> 'a ‑> 'acc * 'b list) ‑> 'acc ‑> 'a list ‑> 'acc * 'b list

fold_flat_map f acc l is a fold_left-like function, but it also maps the +list to a list of lists that is then flatten'd.

  • Since: 0.14
val count : ('a ‑> bool) ‑> 'a list ‑> int

count f l counts how much elements of l comply with the function f.

  • Since: 1.5
val init : int ‑> (int ‑> 'a) ‑> 'a t

init len f is f 0; f 1; ...; f (len-1).

  • Raises Invalid_argument: if len < 0.
  • Since: 0.6
val combine : 'a list ‑> 'b list ‑> ('a * 'b) list

Like List.combine but tail-recursive. +Transform a pair of lists into a list of pairs: +combine [a1; ...; an] [b1; ...; bn] is +[(a1,b1); ...; (an,bn)].

  • Raises Invalid_argument: if the lists have distinct lengths.
  • Since: 1.2
val combine_gen : 'a list ‑> 'b list ‑> ('a * 'b) gen

Lazy version of combine. +Unlike combine, it does not fail if the lists have different +lengths; +instead, the output has as many pairs as the smallest input list.

  • Since: 1.2
val split : ('a * 'b) t ‑> 'a t * 'b t

A tail-recursive version of List.split. +Transform a list of pairs into a pair of lists: +split [(a1,b1); ...; (an,bn)] is ([a1; ...; an], [b1; ...; bn]).

val compare : ('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a t ‑> int
val compare_lengths : 'a t ‑> 'b t ‑> int

Equivalent to compare (length l1) (length l2) but more efficient. +Compare the lengths of two lists.

  • Since: 1.5
val compare_length_with : 'a t ‑> int ‑> int

Equivalent to compare (length l) x but more efficient. +Compare the length of a list to an integer.

  • Since: 1.5
val equal : ('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool
val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b t

Map and flatten at the same time (safe). Evaluation order is not guaranteed.

val flatten : 'a t t ‑> 'a t

Safe flatten. Concatenate a list of lists.

val product : ('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t

Cartesian product of the two lists, with the given combinator.

val fold_product : ('c ‑> 'a ‑> 'b ‑> 'c) ‑> 'c ‑> 'a t ‑> 'b t ‑> 'c

Fold on the cartesian product.

val cartesian_product : 'a t t ‑> 'a t t

Produce the cartesian product of this list of lists, +by returning all the ways of picking one element per sublist. +NOTE the order of the returned list is unspecified. +For example: +

      # cartesian_product [[1;2];[3];[4;5;6]] |> sort =
+      [[1;3;4];[1;3;5];[1;3;6];[2;3;4];[2;3;5];[2;3;6]];;
+      # cartesian_product [[1;2];[];[4;5;6]] = [];;
+      # cartesian_product [[1;2];[3];[4];[5];[6]] |> sort =
+      [[1;3;4;5;6];[2;3;4;5;6]];;

+invariant: cartesian_product l = map_product id l.

  • Since: 1.2
val map_product_l : ('a ‑> 'b list) ‑> 'a list ‑> 'b list list

map_product_l f l maps each element of l to a list of +objects of type 'b using f. +We obtain [l1;l2;...;ln] where length l=n and li : 'b list. +Then, it returns all the ways of picking exactly one element per li.

  • Since: 1.2
val diagonal : 'a t ‑> ('a * 'a) t

All pairs of distinct positions of the list. list_diagonal l will +return the list of List.nth i l, List.nth j l if i < j.

val partition_map : ('a ‑> [< `Left of 'b | `Right of 'c | `Drop ]) ‑> 'a list ‑> 'b list * 'c list

partition_map f l maps f on l and gather results in lists: +

  • if f x = `Left y, adds y to the first list.
  • if f x = `Right z, adds z to the second list.
  • if f x = `Drop, ignores x.
  • Since: 0.11
val group_by : ?⁠hash:('a ‑> int) ‑> ?⁠eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a list t

Group equal elements, regardless of their order of appearance. +precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • Since: 2.3
val join : join_row:('a ‑> 'b ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

join ~join_row a b combines every element of a with every +element of b using join_row. If join_row returns None, then +the two elements do not combine. Assume that b allows for multiple +iterations.

  • Since: 2.3
val join_by : ?⁠eq:('key ‑> 'key ‑> bool) ‑> ?⁠hash:('key ‑> int) ‑> ('a ‑> 'key) ‑> ('b ‑> 'key) ‑> merge:('key ‑> 'a ‑> 'b ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

join key1 key2 ~merge is a binary operation +that takes two sequences a and b, projects their +elements resp. with key1 and key2, and combine +values (x,y) from (a,b) with the same key +using merge. If merge returns None, the combination +of values is discarded. +precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • Since: 2.3
val join_all_by : ?⁠eq:('key ‑> 'key ‑> bool) ‑> ?⁠hash:('key ‑> int) ‑> ('a ‑> 'key) ‑> ('b ‑> 'key) ‑> merge:('key ‑> 'a list ‑> 'b list ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

join_all_by key1 key2 ~merge is a binary operation +that takes two sequences a and b, projects their +elements resp. with key1 and key2, and, for each key k +occurring in at least one of them: +

  • compute the list l1 of elements of a that map to k
  • compute the list l2 of elements of b that map to k
  • call merge k l1 l2. If merge returns None, the combination +of values is discarded, otherwise it returns Some c +and c is inserted in the result.
  • Since: 2.3
val group_join_by : ?⁠eq:('a ‑> 'a ‑> bool) ‑> ?⁠hash:('a ‑> int) ‑> ('b ‑> 'a) ‑> 'a t ‑> 'b t ‑> ('a * 'b list) t

group_join_by key2 associates to every element x of +the first sequence, all the elements y of the second +sequence such that eq x (key y). Elements of the first +sequences without corresponding values in the second one +are mapped to [] +precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • Since: 2.3
val sublists_of_len : ?⁠last:('a list ‑> 'a list option) ‑> ?⁠offset:int ‑> int ‑> 'a list ‑> 'a list list

sublists_of_len n l returns sub-lists of l that have length n. +By default, these sub-lists are non overlapping: +sublists_of_len 2 [1;2;3;4;5;6] returns [1;2]; [3;4]; [5;6].

Examples:

  • sublists_of_len 2 [1;2;3;4;5;6] = [[1;2]; [3;4]; [5;6]].
  • sublists_of_len 2 ~offset:3 [1;2;3;4;5;6] = [1;2];[4;5].
  • sublists_of_len 3 ~last:CCOpt.return [1;2;3;4] = [1;2;3];[4].
  • sublists_of_len 2 [1;2;3;4;5] = [[1;2]; [3;4]].
  • Parameter offset: the number of elements skipped between two consecutive +sub-lists. By default it is n. If offset < n, the sub-lists +will overlap; if offset > n, some elements will not appear at all.
  • Parameter last: if provided and the last group of elements g is such +that length g < n, last g is called. If last g = Some g', +g' is appended; otherwise g is dropped. +If last = CCOpt.return, it will simply keep the last group. +By default, last = fun _ -> None, i.e. the last group is dropped if shorter than n.
  • Raises Invalid_argument: if offset <= 0 or n <= 0.
  • Since: 1.0
val intersperse : 'a ‑> 'a list ‑> 'a list

Insert the first argument between every element of the list.

  • Since: 2.1
val interleave : 'a list ‑> 'a list ‑> 'a list

interleave [x1…xn] [y1…ym] is x1,y1,x2,y2,… and finishes with +the suffix of the longest list.

  • Since: 2.1
val pure : 'a ‑> 'a t

pure is return.

val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

funs <*> l is product (fun f x -> f x) funs l.

val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

(<$>) = map.

val return : 'a ‑> 'a t

return x is x.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

l >>= f is flat_map f l.

val take : int ‑> 'a t ‑> 'a t

Take the n first elements, drop the rest.

val drop : int ‑> 'a t ‑> 'a t

Drop the n first elements, keep the rest.

val hd_tl : 'a t ‑> 'a * 'a t

hd_tl (x :: l) returns hd, l.

  • Raises Failure: if the list is empty.
  • Since: 0.16
val take_drop : int ‑> 'a t ‑> 'a t * 'a t

take_drop n l returns l1, l2 such that l1 @ l2 = l and +length l1 = min (length l) n.

val take_while : ('a ‑> bool) ‑> 'a t ‑> 'a t

take_while f l returns the longest prefix of l for which f is true.

  • Since: 0.13
val drop_while : ('a ‑> bool) ‑> 'a t ‑> 'a t

drop_while f l drops the longest prefix of l for which f is true.

  • Since: 0.13
val take_drop_while : ('a ‑> bool) ‑> 'a t ‑> 'a t * 'a t

take_drop_while p l = take_while p l, drop_while p l.

  • Since: 1.2
val last : int ‑> 'a t ‑> 'a t

last n l takes the last n elements of l (or less if +l doesn't have that many elements).

val head_opt : 'a t ‑> 'a option

First element.

  • Since: 0.20
val tail_opt : 'a t ‑> 'a t option

Return the given list without its first element.

  • Since: 2.0
val last_opt : 'a t ‑> 'a option

Last element.

  • Since: 0.20
val find_pred : ('a ‑> bool) ‑> 'a t ‑> 'a option

find_pred p l finds the first element of l that satisfies p, +or returns None if no element satisfies p.

  • Since: 0.11
val find_opt : ('a ‑> bool) ‑> 'a t ‑> 'a option

Safe version of find.

  • Since: 1.5
val find_pred_exn : ('a ‑> bool) ‑> 'a t ‑> 'a

Unsafe version of find_pred.

  • Raises Not_found: if no such element is found.
  • Since: 0.11
val find_map : ('a ‑> 'b option) ‑> 'a t ‑> 'b option

find_map f l traverses l, applying f to each element. If for +some element x, f x = Some y, then Some y is returned. Otherwise +the call returns None.

  • Since: 0.11
val find_mapi : (int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b option

Like find_map, but also pass the index to the predicate function.

  • Since: 0.11
val find_idx : ('a ‑> bool) ‑> 'a t ‑> (int * 'a) option

find_idx p x returns Some (i,x) where x is the i-th element of l, +and p x holds. Otherwise returns None.

val remove : eq:('a ‑> 'a ‑> bool) ‑> x:'a ‑> 'a t ‑> 'a t

remove ~x l removes every instance of x from l. Tail-recursive.

  • Parameter eq: equality function.
  • Since: 0.11
val filter_map : ('a ‑> 'b option) ‑> 'a t ‑> 'b t

filter_map f l is the sublist of l containing only elements for which +f returns Some e. +Map and remove elements at the same time.

val keep_some : 'a option t ‑> 'a t

keep_some l retains only elements of the form Some x. +Like filter_map CCFun.id.

  • Since: 1.3
val keep_ok : ('a_) Result.result t ‑> 'a t

keep_ok l retains only elements of the form Ok x.

  • Since: 1.3
val all_some : 'a option t ‑> 'a t option

all_some l returns Some l' if all elements of l are of the form Some x, +or None otherwise.

  • Since: 1.3
val all_ok : ('a'err) Result.result t ‑> ('a t'err) Result.result

all_ok l returns Ok l' if all elements of l are of the form Ok x, +or Error e otherwise (with the first error met).

  • Since: 1.3
val sorted_merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list

Merge elements from both sorted list.

val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list

Sort the list and remove duplicate elements.

val sorted_merge_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list

sorted_merge_uniq l1 l2 merges the sorted lists l1 and l2 and +removes duplicates.

  • Since: 0.10
val is_sorted : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> bool

is_sorted l returns true iff l is sorted (according to given order).

  • Parameter cmp: the comparison function (default Pervasives.compare).
  • Since: 0.17
val sorted_insert : cmp:('a ‑> 'a ‑> int) ‑> ?⁠uniq:bool ‑> 'a ‑> 'a list ‑> 'a list

sorted_insert x l inserts x into l such that, if l was sorted, +then sorted_insert x l is sorted too.

  • Parameter uniq: if true and x is already in sorted position in l, then +x is not duplicated. Default false (x will be inserted in any case).
  • Since: 0.17
val uniq_succ : eq:('a ‑> 'a ‑> bool) ‑> 'a list ‑> 'a list

uniq_succ l removes duplicate elements that occur one next to the other. +Examples: +uniq_succ [1;2;1] = [1;2;1]. +uniq_succ [1;1;2] = [1;2].

  • Since: 0.10
val group_succ : eq:('a ‑> 'a ‑> bool) ‑> 'a list ‑> 'a list list

group_succ ~eq l groups together consecutive elements that are equal +according to eq.

  • Since: 0.11

Indices

val mapi : (int ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Like map, but the function is applied to the index of +the element as first argument (counting from 0), and the element +itself as second argument.

val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Like iter, but the function is applied to the index of +the element as first argument (counting from 0), and the element +itself as second argument.

val iteri2 : (int ‑> 'a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit

Iter on two lists.

  • Raises Invalid_argument: when lists do not have the same length.
  • Since: 2.0
val foldi : ('b ‑> int ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

Like fold but it also passes in the index of each element to the folded function. Tail-recursive.

val foldi2 : ('c ‑> int ‑> 'a ‑> 'b ‑> 'c) ‑> 'c ‑> 'a t ‑> 'b t ‑> 'c

Fold on two lists, with index.

  • Raises Invalid_argument: when lists do not have the same length.
  • Since: 2.0
val get_at_idx : int ‑> 'a t ‑> 'a option

Get by index in the list. +If the index is negative, it will get element starting from the end +of the list.

val nth_opt : 'a t ‑> int ‑> 'a option

Safe version of nth.

  • Raises Invalid_argument: if the int is negative.
  • Since: 1.5
val get_at_idx_exn : int ‑> 'a t ‑> 'a

Get the i-th element, or

  • Raises Not_found: if the index is invalid. +If the index is negative, it will get element starting from the end +of the list.
val set_at_idx : int ‑> 'a ‑> 'a t ‑> 'a t

Set i-th element (removes the old one), or does nothing if +index is too high. +If the index is negative, it will set element starting from the end +of the list.

val insert_at_idx : int ‑> 'a ‑> 'a t ‑> 'a t

Insert at i-th position, between the two existing elements. If the +index is too high, append at the end of the list. +If the index is negative, it will insert element starting from the end +of the list.

val remove_at_idx : int ‑> 'a t ‑> 'a t

Remove element at given index. Does nothing if the index is +too high. +If the index is negative, it will remove element starting from the end +of the list.

Set Operators

Those operations maintain the invariant that the list does not +contain duplicates (if it already satisfies it).

val add_nodup : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> 'a t ‑> 'a t

add_nodup x set adds x to set if it was not already present. Linear time.

  • Since: 0.11
val remove_one : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> 'a t ‑> 'a t

remove_one x set removes one occurrence of x from set. Linear time.

  • Since: 0.11
val mem : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> 'a t ‑> bool

Membership to the list. Linear time.

val subset : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool

Test for inclusion.

val uniq : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t

Remove duplicates w.r.t the equality predicate. +Complexity is quadratic in the length of the list, but the order +of elements is preserved. If you wish for a faster de-duplication +but do not care about the order, use sort_uniq.

val union : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> 'a t

List union. Complexity is product of length of inputs.

val inter : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> 'a t

List intersection. Complexity is product of length of inputs.

Other Constructors

val range_by : step:int ‑> int ‑> int ‑> int t

range_by ~step i j iterates on integers from i to j included, +where the difference between successive elements is step. +Use a negative step for a decreasing list.

  • Raises Invalid_argument: if step=0.
  • Since: 0.18
val range : int ‑> int ‑> int t

range i j iterates on integers from i to j included. It works +both for decreasing and increasing ranges.

val range' : int ‑> int ‑> int t

Like range but the second bound is excluded. +For instance range' 0 5 = [0;1;2;3;4].

val (--) : int ‑> int ‑> int t

Infix alias for range.

val (--^) : int ‑> int ‑> int t

Infix alias for range'.

  • Since: 0.17
val replicate : int ‑> 'a ‑> 'a t

Replicate the given element n times.

val repeat : int ‑> 'a t ‑> 'a t

Concatenate the list with itself n times.

Association Lists

module Assoc : sig ... end
val assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> 'b

Like Assoc.get_exn.

  • Since: 2.0
val assoc_opt : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> 'b option

Like Assoc.get.

  • Since: 1.5
val assq_opt : 'a ‑> ('a * 'b) t ‑> 'b option

Safe version of assq.

  • Since: 1.5
val mem_assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * _) t ‑> bool

Like Assoc.mem.

  • Since: 2.0
val remove_assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> ('a * 'b) t

Like Assoc.remove.

  • Since: 2.0

References on Lists

module Ref : sig ... end
module type MONAD : sig ... end

Monadic Operations

module Traverse : functor (M : MONAD) -> sig ... end

Conversions

val random : 'a random_gen ‑> 'a t random_gen
val random_non_empty : 'a random_gen ‑> 'a t random_gen
val random_len : int ‑> 'a random_gen ‑> 'a t random_gen
val random_choose : 'a t ‑> 'a random_gen

Randomly choose an element in the list.

  • Raises Not_found: if the list is empty.
val random_sequence : 'a random_gen t ‑> 'a t random_gen
val to_seq : 'a t ‑> 'a sequence

Return a sequence of the elements of the list.

val of_seq : 'a sequence ‑> 'a t

Build a list from a given sequence. +In the result, elements appear in the same order as they did in the source sequence.

val to_gen : 'a t ‑> 'a gen

Return a gen of the elements of the list.

val of_gen : 'a gen ‑> 'a t

Build a list from a given gen. +In the result, elements appear in the same order as they did in the source gen.

val to_klist : 'a t ‑> 'a klist

Return a klist of the elements of the list.

val of_klist : 'a klist ‑> 'a t

Build a list from a given klist. +In the result, elements appear in the same order as they did in the source klist.

Infix Operators

+It is convenient to open CCList.Infix to access the infix operators +without cluttering the scope too much.

module Infix : sig ... end

IO

val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a printer ‑> 'a t printer

Print the contents of a list.

\ No newline at end of file diff --git a/2.3/containers/CCList/module-type-MONAD/index.html b/2.3/containers/CCList/module-type-MONAD/index.html new file mode 100644 index 00000000..732eec61 --- /dev/null +++ b/2.3/containers/CCList/module-type-MONAD/index.html @@ -0,0 +1,2 @@ + +MONAD (containers.CCList.MONAD)

Module type CCList.MONAD

Monadic Operations

type 'a t
val return : 'a ‑> 'a t

Monadic return.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind.

\ No newline at end of file diff --git a/2.3/containers/CCListLabels/.jbuilder-keep b/2.3/containers/CCListLabels/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCListLabels/Assoc/index.html b/2.3/containers/CCListLabels/Assoc/index.html new file mode 100644 index 00000000..03850fd6 --- /dev/null +++ b/2.3/containers/CCListLabels/Assoc/index.html @@ -0,0 +1,4 @@ + +Assoc (containers.CCListLabels.Assoc)

Module CCListLabels.Assoc

type ('a, 'b) t = ('a * 'b) list
val get : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> 'b option

Find the element.

val get_exn : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> 'b

Like get, but unsafe.

  • Raises Not_found: if the element is not present.
val set : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> 'b ‑> ('a'bt ‑> ('a'bt

Add the binding into the list (erase it if already present).

val mem : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a_t ‑> bool

mem x l returns true iff x is a key in l.

  • Since: 0.16
val update : eq:('a ‑> 'a ‑> bool) ‑> f:('b option ‑> 'b option) ‑> 'a ‑> ('a'bt ‑> ('a'bt

update k ~f l updates l on the key k, by calling f (get l k) +and removing k if it returns None, mapping k to v' if it +returns Some v'.

  • Since: 0.16
val remove : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> ('a'bt

remove x l removes the first occurrence of k from l.

  • Since: 0.17
\ No newline at end of file diff --git a/2.3/containers/CCListLabels/Infix/index.html b/2.3/containers/CCListLabels/Infix/index.html new file mode 100644 index 00000000..24171d39 --- /dev/null +++ b/2.3/containers/CCListLabels/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCListLabels.Infix)

Module CCListLabels.Infix

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map with reversed arguments.

val (@) : 'a t ‑> 'a t ‑> 'a t

As append. Concatenate two lists.

val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

funs <*> l is product (fun f x -> f x) funs l.

val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

As map.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

l >>= f is flat_map f l.

val (--) : int ‑> int ‑> int t

Infix alias for range. Bounds included.

val (--^) : int ‑> int ‑> int t

Infix alias for range'. Second bound excluded.

\ No newline at end of file diff --git a/2.3/containers/CCListLabels/Ref/index.html b/2.3/containers/CCListLabels/Ref/index.html new file mode 100644 index 00000000..0d34dd03 --- /dev/null +++ b/2.3/containers/CCListLabels/Ref/index.html @@ -0,0 +1,3 @@ + +Ref (containers.CCListLabels.Ref)

Module CCListLabels.Ref

type 'a t = 'a list Pervasives.ref
val push : 'a t ‑> 'a ‑> unit
val pop : 'a t ‑> 'a option
val pop_exn : 'a t ‑> 'a

Unsafe version of pop.

  • Raises Failure: if the list is empty.
val create : unit ‑> 'a t

Create a new list reference.

val clear : _ t ‑> unit

Remove all elements.

val lift : ('a list ‑> 'b) ‑> 'a t ‑> 'b

Apply a list function to the content.

val push_list : 'a t ‑> 'a list ‑> unit

Add elements of the list at the beginning of the list ref. Elements +at the end of the list will be at the beginning of the list ref.

\ No newline at end of file diff --git a/2.3/containers/CCListLabels/Traverse/argument-1-M/index.html b/2.3/containers/CCListLabels/Traverse/argument-1-M/index.html new file mode 100644 index 00000000..4d3ab9eb --- /dev/null +++ b/2.3/containers/CCListLabels/Traverse/argument-1-M/index.html @@ -0,0 +1,2 @@ + +1-M (containers.CCListLabels.Traverse.1-M)

Parameter CCListLabels.Traverse.1-M

type 'a t
val return : 'a ‑> 'a t

Monadic return.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind.

\ No newline at end of file diff --git a/2.3/containers/CCListLabels/Traverse/index.html b/2.3/containers/CCListLabels/Traverse/index.html new file mode 100644 index 00000000..e8fbf9d2 --- /dev/null +++ b/2.3/containers/CCListLabels/Traverse/index.html @@ -0,0 +1,4 @@ + +Traverse (containers.CCListLabels.Traverse)

Module CCListLabels.Traverse

Parameters

Signature

val sequence_m : 'a M.t t ‑> 'a t M.t
val fold_m : f:('b ‑> 'a ‑> 'b M.t) ‑> init:'b ‑> 'a t ‑> 'b M.t
val map_m : f:('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t
val map_m_par : f:('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t

Like map_m but map_m_par f (x::l) evaluates f x and +f l "in parallel" before combining their result (for instance +in Lwt).

\ No newline at end of file diff --git a/2.3/containers/CCListLabels/index.html b/2.3/containers/CCListLabels/index.html new file mode 100644 index 00000000..7ca1c141 --- /dev/null +++ b/2.3/containers/CCListLabels/index.html @@ -0,0 +1,82 @@ + +CCListLabels (containers.CCListLabels)

Module CCListLabels

Complements to list

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a random_gen = Random.State.t ‑> 'a
include module type of ListLabels
val length : 'a list ‑> int
val hd : 'a list ‑> 'a
val compare_lengths : 'a list ‑> 'b list ‑> int
val compare_length_with : 'a list ‑> len:int ‑> int
val cons : 'a ‑> 'a list ‑> 'a list
val tl : 'a list ‑> 'a list
val nth : 'a list ‑> int ‑> 'a
val nth_opt : 'a list ‑> int ‑> 'a option
val rev : 'a list ‑> 'a list
val init : len:int ‑> f:(int ‑> 'a) ‑> 'a list
val append : 'a list ‑> 'a list ‑> 'a list
val rev_append : 'a list ‑> 'a list ‑> 'a list
val concat : 'a list list ‑> 'a list
val flatten : 'a list list ‑> 'a list
val iter : f:('a ‑> unit) ‑> 'a list ‑> unit
val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a list ‑> unit
val map : f:('a ‑> 'b) ‑> 'a list ‑> 'b list
val mapi : f:(int ‑> 'a ‑> 'b) ‑> 'a list ‑> 'b list
val rev_map : f:('a ‑> 'b) ‑> 'a list ‑> 'b list
val fold_left : f:('a ‑> 'b ‑> 'a) ‑> init:'a ‑> 'b list ‑> 'a
val fold_right : f:('a ‑> 'b ‑> 'b) ‑> 'a list ‑> init:'b ‑> 'b
val iter2 : f:('a ‑> 'b ‑> unit) ‑> 'a list ‑> 'b list ‑> unit
val map2 : f:('a ‑> 'b ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c list
val rev_map2 : f:('a ‑> 'b ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c list
val fold_left2 : f:('a ‑> 'b ‑> 'c ‑> 'a) ‑> init:'a ‑> 'b list ‑> 'c list ‑> 'a
val fold_right2 : f:('a ‑> 'b ‑> 'c ‑> 'c) ‑> 'a list ‑> 'b list ‑> init:'c ‑> 'c
val for_all : f:('a ‑> bool) ‑> 'a list ‑> bool
val exists : f:('a ‑> bool) ‑> 'a list ‑> bool
val for_all2 : f:('a ‑> 'b ‑> bool) ‑> 'a list ‑> 'b list ‑> bool
val exists2 : f:('a ‑> 'b ‑> bool) ‑> 'a list ‑> 'b list ‑> bool
val mem : 'a ‑> set:'a list ‑> bool
val memq : 'a ‑> set:'a list ‑> bool
val find : f:('a ‑> bool) ‑> 'a list ‑> 'a
val find_opt : f:('a ‑> bool) ‑> 'a list ‑> 'a option
val filter : f:('a ‑> bool) ‑> 'a list ‑> 'a list
val find_all : f:('a ‑> bool) ‑> 'a list ‑> 'a list
val partition : f:('a ‑> bool) ‑> 'a list ‑> 'a list * 'a list
val assoc : 'a ‑> ('a * 'b) list ‑> 'b
val assoc_opt : 'a ‑> ('a * 'b) list ‑> 'b option
val assq : 'a ‑> ('a * 'b) list ‑> 'b
val assq_opt : 'a ‑> ('a * 'b) list ‑> 'b option
val mem_assoc : 'a ‑> map:('a * 'b) list ‑> bool
val mem_assq : 'a ‑> map:('a * 'b) list ‑> bool
val remove_assoc : 'a ‑> ('a * 'b) list ‑> ('a * 'b) list
val remove_assq : 'a ‑> ('a * 'b) list ‑> ('a * 'b) list
val split : ('a * 'b) list ‑> 'a list * 'b list
val combine : 'a list ‑> 'b list ‑> ('a * 'b) list
val sort : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
val stable_sort : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
val fast_sort : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
val merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list
type 'a t = 'a list
val empty : 'a t

empty is [].

val is_empty : _ t ‑> bool

is_empty l returns true iff l = [].

  • Since: 0.11
val map : f:('a ‑> 'b) ‑> 'a t ‑> 'b t

Safe version of List.map.

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map with reversed arguments.

  • Since: 0.5
val cons : 'a ‑> 'a t ‑> 'a t

cons x l is x::l.

  • Since: 0.12
val append : 'a t ‑> 'a t ‑> 'a t

Safe version of List.append. +Concatenate two lists.

val cons_maybe : 'a option ‑> 'a t ‑> 'a t

cons_maybe (Some x) l is x :: l. +cons_maybe None l is l.

  • Since: 0.13
val (@) : 'a t ‑> 'a t ‑> 'a t

Like append. +Concatenate two lists.

val filter : f:('a ‑> bool) ‑> 'a t ‑> 'a t

Safe version of List.filter. +filter p l returns all the elements of the list l +that satisfy the predicate p. The order of the elements +in the input list is preserved.

val fold_right : ('a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b

Safe version of fold_right. +fold_right f [a1; ...; an] b is +f a1 (f a2 (... (f an b) ...)). Not tail-recursive.

val fold_while : f:('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> init:'a ‑> 'b t ‑> 'a

Fold until a stop condition via ('a, `Stop) is +indicated by the accumulator.

  • Since: 0.8
val fold_map : f:('acc ‑> 'a ‑> 'acc * 'b) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b list

fold_map ~f ~init l is a fold_left-like function, but it also maps the +list to another list.

  • Since: 0.14
val scan_left : f:('acc ‑> 'a ‑> 'acc) ‑> init:'acc ‑> 'a list ‑> 'acc list
  • Since: 2.2
val fold_map2 : f:('acc ‑> 'a ‑> 'b ‑> 'acc * 'c) ‑> init:'acc ‑> 'a list ‑> 'b list ‑> 'acc * 'c list

fold_map2 is to fold_map what List.map2 is to List.map.

  • Raises Invalid_argument: if the lists do not have the same length.
  • Since: 0.16
val fold_filter_map : f:('acc ‑> 'a ‑> 'acc * 'b option) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b list

fold_filter_map ~f ~init l is a fold_left-like function, but also +generates a list of output in a way similar to filter_map.

  • Since: 0.17
val fold_flat_map : f:('acc ‑> 'a ‑> 'acc * 'b list) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b list

fold_flat_map f acc l is a fold_left-like function, but it also maps the +list to a list of lists that is then flatten'd.

  • Since: 0.14
val count : f:('a ‑> bool) ‑> 'a list ‑> int
  • Since: 2.2
val init : int ‑> f:(int ‑> 'a) ‑> 'a t

init len ~f is f 0; f 1; ...; f (len-1).

  • Raises Invalid_argument: if len < 0.
  • Since: 0.6
val combine : 'a list ‑> 'b list ‑> ('a * 'b) list
  • Since: 2.2
val combine_gen : 'a list ‑> 'b list ‑> ('a * 'b) gen
  • Since: 2.2
val split : ('a * 'b) t ‑> 'a t * 'b t
  • Since: 2.2
val compare : ('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a t ‑> int
val compare_lengths : 'a t ‑> 'b t ‑> int
  • Since: 2.2
val compare_length_with : 'a t ‑> int ‑> int
  • Since: 2.2
val equal : ('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool
val flat_map : f:('a ‑> 'b t) ‑> 'a t ‑> 'b t

Map and flatten at the same time (safe). Evaluation order is not guaranteed.

val flatten : 'a t t ‑> 'a t

Safe flatten. Concatenate a list of lists.

val product : f:('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t

Cartesian product of the two lists, with the given combinator.

val fold_product : f:('c ‑> 'a ‑> 'b ‑> 'c) ‑> init:'c ‑> 'a t ‑> 'b t ‑> 'c

Fold on the cartesian product.

val cartesian_product : 'a t t ‑> 'a t t
  • Since: 2.2
val map_product_l : f:('a ‑> 'b list) ‑> 'a list ‑> 'b list list
  • Since: 2.2
val diagonal : 'a t ‑> ('a * 'a) t

All pairs of distinct positions of the list. list_diagonal l will +return the list of List.nth i l, List.nth j l if i < j.

val partition_map : f:('a ‑> [< `Left of 'b | `Right of 'c | `Drop ]) ‑> 'a list ‑> 'b list * 'c list

partition_map ~f l maps f on l and gather results in lists: +

  • if f x = `Left y, adds y to the first list.
  • if f x = `Right z, adds z to the second list.
  • if f x = `Drop, ignores x.
  • Since: 0.11
val group_by : ?⁠hash:('a ‑> int) ‑> ?⁠eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a list t

Group equal elements, regardless of their order of appearance. +precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • Since: 2.3
val join : join_row:('a ‑> 'b ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

join ~join_row a b combines every element of a with every +element of b using join_row. If join_row returns None, then +the two elements do not combine. Assume that b allows for multiple +iterations.

  • Since: 2.3
val join_by : ?⁠eq:('key ‑> 'key ‑> bool) ‑> ?⁠hash:('key ‑> int) ‑> ('a ‑> 'key) ‑> ('b ‑> 'key) ‑> merge:('key ‑> 'a ‑> 'b ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

join key1 key2 ~merge is a binary operation +that takes two sequences a and b, projects their +elements resp. with key1 and key2, and combine +values (x,y) from (a,b) with the same key +using merge. If merge returns None, the combination +of values is discarded. +precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • Since: 2.3
val join_all_by : ?⁠eq:('key ‑> 'key ‑> bool) ‑> ?⁠hash:('key ‑> int) ‑> ('a ‑> 'key) ‑> ('b ‑> 'key) ‑> merge:('key ‑> 'a list ‑> 'b list ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

join_all_by key1 key2 ~merge is a binary operation +that takes two sequences a and b, projects their +elements resp. with key1 and key2, and, for each key k +occurring in at least one of them: +

  • compute the list l1 of elements of a that map to k
  • compute the list l2 of elements of b that map to k
  • call merge k l1 l2. If merge returns None, the combination +of values is discarded, otherwise it returns Some c +and c is inserted in the result.
  • Since: 2.3
val group_join_by : ?⁠eq:('a ‑> 'a ‑> bool) ‑> ?⁠hash:('a ‑> int) ‑> ('b ‑> 'a) ‑> 'a t ‑> 'b t ‑> ('a * 'b list) t

group_join_by key2 associates to every element x of +the first sequence, all the elements y of the second +sequence such that eq x (key y). Elements of the first +sequences without corresponding values in the second one +are mapped to [] +precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • Since: 2.3
val sublists_of_len : ?⁠last:('a list ‑> 'a list option) ‑> ?⁠offset:int ‑> len:int ‑> 'a list ‑> 'a list list

sublists_of_len n l returns sub-lists of l that have length n. +By default, these sub-lists are non overlapping: +sublists_of_len 2 [1;2;3;4;5;6] returns [1;2]; [3;4]; [5;6].

See CCList.sublists_of_len for more details.

  • Since: 1.5
val intersperse : x:'a ‑> 'a list ‑> 'a list

Insert the first argument between every element of the list.

  • Since: 2.2
val interleave : 'a list ‑> 'a list ‑> 'a list

interleave [x1…xn] [y1…ym] is x1,y1,x2,y2,… and finishes with +the suffix of the longest list.

  • Since: 2.2
val pure : 'a ‑> 'a t

pure is return.

val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

funs <*> l is product fun f x -> f x) funs l.

val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

(<$>) is map.

val return : 'a ‑> 'a t

return x is x.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

l >>= f is flat_map f l.

val take : int ‑> 'a t ‑> 'a t

Take the n first elements, drop the rest.

val drop : int ‑> 'a t ‑> 'a t

Drop the n first elements, keep the rest.

val hd_tl : 'a t ‑> 'a * 'a t

hd_tl (x :: l) returns hd, l.

  • Raises Failure: if the list is empty.
  • Since: 0.16
val take_drop : int ‑> 'a t ‑> 'a t * 'a t

take_drop n l returns l1, l2 such that l1 @ l2 = l and +length l1 = min (length l) n.

val take_while : f:('a ‑> bool) ‑> 'a t ‑> 'a t

take_while ~f l returns the longest prefix of l for which f is true.

  • Since: 0.13
val drop_while : f:('a ‑> bool) ‑> 'a t ‑> 'a t

drop_while ~f l drops the longest prefix of l for which f is true.

  • Since: 0.13
val take_drop_while : f:('a ‑> bool) ‑> 'a t ‑> 'a t * 'a t
  • Since: 2.2
val last : int ‑> 'a t ‑> 'a t

last n l takes the last n elements of l (or less if +l doesn't have that many elements).

val head_opt : 'a t ‑> 'a option

First element.

  • Since: 0.20
val tail_opt : 'a t ‑> 'a t option

Return the given list without its first element.

  • Since: 2.0
val last_opt : 'a t ‑> 'a option

Last element.

  • Since: 0.20
val find_pred : f:('a ‑> bool) ‑> 'a t ‑> 'a option

find_pred p l finds the first element of l that satisfies p, +or returns None if no element satisfies p.

  • Since: 0.11
val find_opt : f:('a ‑> bool) ‑> 'a t ‑> 'a option
  • Since: 2.2
val find_pred_exn : f:('a ‑> bool) ‑> 'a t ‑> 'a

Unsafe version of find_pred.

  • Raises Not_found: if no such element is found.
  • Since: 0.11
val find_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b option

find_map ~f l traverses l, applying f to each element. If for +some element x, f x = Some y, then Some y is returned. Otherwise +the call returns None.

  • Since: 0.11
val find_mapi : f:(int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b option

Like find_map, but also pass the index to the predicate function.

  • Since: 0.11
val find_idx : f:('a ‑> bool) ‑> 'a t ‑> (int * 'a) option

find_idx p x returns Some (i,x) where x is the i-th element of l, +and p x holds. Otherwise returns None.

val remove : eq:('a ‑> 'a ‑> bool) ‑> key:'a ‑> 'a t ‑> 'a t

remove ~key l removes every instance of key from l. Tail-recursive.

  • Parameter eq: equality function.
  • Since: 0.11
val filter_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b t

filter_map ~f l is the sublist of l containing only elements for which +f returns Some e. +Map and remove elements at the same time.

val keep_some : 'a option t ‑> 'a t
  • Since: 2.2
val keep_ok : ('a_) Result.result t ‑> 'a t
  • Since: 2.2
val all_some : 'a option t ‑> 'a t option
  • Since: 2.2
val all_ok : ('a'err) Result.result t ‑> ('a t'err) Result.result
  • Since: 2.2
val sorted_merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list

Merges elements from both sorted list.

val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list

Sort the list and remove duplicate elements.

val sorted_merge_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list

sorted_merge_uniq l1 l2 merges the sorted lists l1 and l2 and +removes duplicates.

  • Since: 0.10
val is_sorted : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> bool

is_sorted l returns true iff l is sorted (according to given order).

  • Parameter cmp: the comparison function (default Pervasives.compare).
  • Since: 0.17
val sorted_insert : cmp:('a ‑> 'a ‑> int) ‑> ?⁠uniq:bool ‑> 'a ‑> 'a list ‑> 'a list

sorted_insert x l inserts x into l such that, if l was sorted, +then sorted_insert x l is sorted too.

  • Parameter uniq: if true and x is already in sorted position in l, then +x is not duplicated. Default false (x will be inserted in any case).
  • Since: 0.17
val uniq_succ : eq:('a ‑> 'a ‑> bool) ‑> 'a list ‑> 'a list

uniq_succ l removes duplicate elements that occur one next to the other. +Examples: +uniq_succ [1;2;1] = [1;2;1]. +uniq_succ [1;1;2] = [1;2].

  • Since: 0.10
val group_succ : eq:('a ‑> 'a ‑> bool) ‑> 'a list ‑> 'a list list

group_succ ~eq l groups together consecutive elements that are equal +according to eq.

  • Since: 0.11

Indices

val mapi : f:(int ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Like map, but the function is applied to the index of +the element as first argument (counting from 0), and the element +itself as second argument.

val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Like iter, but the function is applied to the index of +the element as first argument (counting from 0), and the element +itself as second argument.

val iteri2 : f:(int ‑> 'a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit
  • Since: 2.2
val foldi : f:('b ‑> int ‑> 'a ‑> 'b) ‑> init:'b ‑> 'a t ‑> 'b

Like fold but it also passes in the index of each element to the folded function. Tail-recursive.

val foldi2 : f:('c ‑> int ‑> 'a ‑> 'b ‑> 'c) ‑> init:'c ‑> 'a t ‑> 'b t ‑> 'c
  • Since: 2.2
val get_at_idx : int ‑> 'a t ‑> 'a option

Get by index in the list. +If the index is negative, it will get element starting from the end +of the list.

val nth_opt : 'a t ‑> int ‑> 'a option
  • Since: 2.2
val get_at_idx_exn : int ‑> 'a t ‑> 'a

Get the i-th element, or

  • Raises Not_found: if the index is invalid. +If the index is negative, it will get element starting from the end +of the list.
val set_at_idx : int ‑> 'a ‑> 'a t ‑> 'a t

Set i-th element (removes the old one), or does nothing if +index is too high. +If the index is negative, it will set element starting from the end +of the list.

val insert_at_idx : int ‑> 'a ‑> 'a t ‑> 'a t

Insert at i-th position, between the two existing elements. If the +index is too high, append at the end of the list. +If the index is negative, it will insert element starting from the end +of the list.

val remove_at_idx : int ‑> 'a t ‑> 'a t

Remove element at given index. Does nothing if the index is +too high. +If the index is negative, it will remove element starting from the end +of the list.

Set Operators

Those operations maintain the invariant that the list does not +contain duplicates (if it already satisfies it).

val add_nodup : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> 'a t ‑> 'a t

add_nodup x set adds x to set if it was not already present. Linear time.

  • Since: 0.11
val remove_one : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> 'a t ‑> 'a t

remove_one x set removes one occurrence of x from set. Linear time.

  • Since: 0.11
val mem : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> 'a t ‑> bool

Membership to the list. Linear time.

val subset : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool

Test for inclusion.

val uniq : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t

Remove duplicates w.r.t the equality predicate. +Complexity is quadratic in the length of the list, but the order +of elements is preserved. If you wish for a faster de-duplication +but do not care about the order, use sort_uniq.

val union : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> 'a t

List union. Complexity is product of length of inputs.

val inter : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> 'a t

List intersection. Complexity is product of length of inputs.

Other Constructors

val range_by : step:int ‑> int ‑> int ‑> int t

range_by ~step i j iterates on integers from i to j included, +where the difference between successive elements is step. +use a negative step for a decreasing list.

  • Raises Invalid_argument: if step=0.
  • Since: 0.18
val range : int ‑> int ‑> int t

range i j iterates on integers from i to j included. It works +both for decreasing and increasing ranges.

val range' : int ‑> int ‑> int t

Like range but the second bound is excluded. +For instance range' 0 5 = [0;1;2;3;4].

val (--) : int ‑> int ‑> int t

Infix alias for range.

val (--^) : int ‑> int ‑> int t

Infix alias for range'.

  • Since: 0.17
val replicate : int ‑> 'a ‑> 'a t

Replicate the given element n times.

val repeat : int ‑> 'a t ‑> 'a t

Concatenate the list with itself n times.

Association Lists

module Assoc : sig ... end
val assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> 'b

Like Assoc.get_exn.

  • Since: 2.0
val assoc_opt : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> 'b option

Like Assoc.get.

  • Since: 2.0
val assq_opt : 'a ‑> ('a * 'b) t ‑> 'b option

Safe version of assq.

  • Since: 2.0
val mem_assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * _) t ‑> bool

Like Assoc.mem.

  • Since: 2.0
val remove_assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> ('a * 'b) t

Like Assoc.remove.

  • Since: 2.0

References on Lists

module Ref : sig ... end
module type MONAD : sig ... end

Monadic Operations

module Traverse : functor (M : MONAD) -> sig ... end

Conversions

val random : 'a random_gen ‑> 'a t random_gen
val random_non_empty : 'a random_gen ‑> 'a t random_gen
val random_len : int ‑> 'a random_gen ‑> 'a t random_gen
val random_choose : 'a t ‑> 'a random_gen

Randomly choose an element in the list.

  • Raises Not_found: if the list is empty.
val random_sequence : 'a random_gen t ‑> 'a t random_gen
val to_seq : 'a t ‑> 'a sequence

Return a sequence of the elements of the list.

val of_seq : 'a sequence ‑> 'a t

Build a list from a given sequence.

val to_gen : 'a t ‑> 'a gen

Return a gen of the elements of the list.

val of_gen : 'a gen ‑> 'a t

Build a list from a given gen.

val to_klist : 'a t ‑> 'a klist

Return a klist of the elements of the list.

val of_klist : 'a klist ‑> 'a t

Build a list from a given klist.

Infix Operators

+It is convenient to open CCList.Infix to access the infix operators +without cluttering the scope too much.

module Infix : sig ... end

IO

val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a printer ‑> 'a t printer

Print the contents of a list.

\ No newline at end of file diff --git a/2.3/containers/CCListLabels/module-type-MONAD/index.html b/2.3/containers/CCListLabels/module-type-MONAD/index.html new file mode 100644 index 00000000..c74a4bba --- /dev/null +++ b/2.3/containers/CCListLabels/module-type-MONAD/index.html @@ -0,0 +1,2 @@ + +MONAD (containers.CCListLabels.MONAD)

Module type CCListLabels.MONAD

Monadic Operations

type 'a t
val return : 'a ‑> 'a t

Monadic return.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind.

\ No newline at end of file diff --git a/2.3/containers/CCLock/.jbuilder-keep b/2.3/containers/CCLock/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCLock/LockRef/index.html b/2.3/containers/CCLock/LockRef/index.html new file mode 100644 index 00000000..169799f4 --- /dev/null +++ b/2.3/containers/CCLock/LockRef/index.html @@ -0,0 +1,2 @@ + +LockRef (containers.CCLock.LockRef)

Module CCLock.LockRef

Type allowing to manipulate the lock as a reference.

type 'a t
val get : 'a t ‑> 'a
val set : 'a t ‑> 'a ‑> unit
val update : 'a t ‑> ('a ‑> 'a) ‑> unit
\ No newline at end of file diff --git a/2.3/containers/CCLock/index.html b/2.3/containers/CCLock/index.html new file mode 100644 index 00000000..da0c98cc --- /dev/null +++ b/2.3/containers/CCLock/index.html @@ -0,0 +1,10 @@ + +CCLock (containers.CCLock)

Module CCLock

Utils around Mutex

A value wrapped into a Mutex, for more safety.

type 'a t

A value surrounded with a lock

val create : 'a ‑> 'a t

Create a new protected value.

val with_lock : 'a t ‑> ('a ‑> 'b) ‑> 'b

with_lock l f runs f x where x is the value protected with +the lock l, in a critical section. If f x fails, with_lock l f +fails too but the lock is released.

val try_with_lock : 'a t ‑> ('a ‑> 'b) ‑> 'b option

try_with_lock l f runs f x in a critical section if l is not +locked. x is the value protected by the lock l. If f x +fails, try_with_lock l f fails too but the lock is released.

  • Since: 0.22
module LockRef : sig ... end

Type allowing to manipulate the lock as a reference.

val with_lock_as_ref : 'a t ‑> f:('a LockRef.t ‑> 'b) ‑> 'b

with_lock_as_ref l f calls f with a reference-like object +that allows to manipulate the value of l safely. +The object passed to f must not escape the function call.

  • Since: 0.13
val update : 'a t ‑> ('a ‑> 'a) ‑> unit

update l f replaces the content x of l with f x, atomically.

val update_map : 'a t ‑> ('a ‑> 'a * 'b) ‑> 'b

update_map l f computes x', y = f (get l), then puts x' in l +and returns y.

  • Since: 0.16
val mutex : _ t ‑> Mutex.t

Underlying mutex.

val get : 'a t ‑> 'a

Atomically get the value in the lock. The value that is returned +isn't protected!

val set : 'a t ‑> 'a ‑> unit

Atomically set the value.

  • Since: 0.13
val incr : int t ‑> unit

Atomically increment the value.

  • Since: 0.13
val decr : int t ‑> unit

Atomically decrement the value.

  • Since: 0.13
val incr_then_get : int t ‑> int

incr_then_get x increments x, and returns its new value.

  • Since: 0.16
val get_then_incr : int t ‑> int

get_then_incr x increments x, and returns its previous value.

  • Since: 0.16
val decr_then_get : int t ‑> int

decr_then_get x decrements x, and returns its new value.

  • Since: 0.16
val get_then_decr : int t ‑> int

get_then_decr x decrements x, and returns its previous value.

  • Since: 0.16
val get_then_set : bool t ‑> bool

get_then_set b sets b to true, and returns the old value.

  • Since: 0.16
val get_then_clear : bool t ‑> bool

get_then_clear b sets b to false, and returns the old value.

  • Since: 0.16
\ No newline at end of file diff --git a/2.3/containers/CCMap/.jbuilder-keep b/2.3/containers/CCMap/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCMap/index.html b/2.3/containers/CCMap/index.html new file mode 100644 index 00000000..d5ee9cc9 --- /dev/null +++ b/2.3/containers/CCMap/index.html @@ -0,0 +1,2 @@ + +CCMap (containers.CCMap)

Module CCMap

Extensions of Standard Map

Provide useful functions and iterators on Map.S

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a printer = Format.formatter ‑> 'a ‑> unit
module type OrderedType = Map.OrderedType
module type S : sig ... end
module Make : functor (O : Map.OrderedType) -> S with type 'a Make.t = 'a Map.Make(O).t and type Make.key = O.t
\ No newline at end of file diff --git a/2.3/containers/CCMap/module-type-S/index.html b/2.3/containers/CCMap/module-type-S/index.html new file mode 100644 index 00000000..7b263117 --- /dev/null +++ b/2.3/containers/CCMap/module-type-S/index.html @@ -0,0 +1,10 @@ + +S (containers.CCMap.S)

Module type CCMap.S

include Map.S
type key
type +'a t
val empty : 'a t
val is_empty : 'a t ‑> bool
val mem : key ‑> 'a t ‑> bool
val add : key ‑> 'a ‑> 'a t ‑> 'a t
val update : key ‑> ('a option ‑> 'a option) ‑> 'a t ‑> 'a t
val singleton : key ‑> 'a ‑> 'a t
val remove : key ‑> 'a t ‑> 'a t
val merge : (key ‑> 'a option ‑> 'b option ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t
val union : (key ‑> 'a ‑> 'a ‑> 'a option) ‑> 'a t ‑> 'a t ‑> 'a t
val compare : ('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a t ‑> int
val equal : ('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val fold : (key ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
val for_all : (key ‑> 'a ‑> bool) ‑> 'a t ‑> bool
val exists : (key ‑> 'a ‑> bool) ‑> 'a t ‑> bool
val filter : (key ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t
val partition : (key ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t * 'a t
val cardinal : 'a t ‑> int
val bindings : 'a t ‑> (key * 'a) list
val min_binding : 'a t ‑> key * 'a
val min_binding_opt : 'a t ‑> (key * 'a) option
val max_binding : 'a t ‑> key * 'a
val max_binding_opt : 'a t ‑> (key * 'a) option
val choose : 'a t ‑> key * 'a
val choose_opt : 'a t ‑> (key * 'a) option
val split : key ‑> 'a t ‑> 'a t * 'a option * 'a t
val find : key ‑> 'a t ‑> 'a
val find_opt : key ‑> 'a t ‑> 'a option
val find_first : (key ‑> bool) ‑> 'a t ‑> key * 'a
val find_first_opt : (key ‑> bool) ‑> 'a t ‑> (key * 'a) option
val find_last : (key ‑> bool) ‑> 'a t ‑> key * 'a
val find_last_opt : (key ‑> bool) ‑> 'a t ‑> (key * 'a) option
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t
val mapi : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t
val get : key ‑> 'a t ‑> 'a option

Safe version of find.

val get_or : key ‑> 'a t ‑> default:'a ‑> 'a

get_or k m ~default returns the value associated to k if present, +and returns default otherwise (if k doesn't belong in m).

  • Since: 0.16
val update : key ‑> ('a option ‑> 'a option) ‑> 'a t ‑> 'a t

update k f m calls f (Some v) if find k m = v, +otherwise it calls f None. In any case, if the result is Nonek is removed from m, and if the result is Some v' then +add k v' m is returned.

val choose_opt : 'a t ‑> (key * 'a) option

Safe version of choose.

  • Since: 1.5
val min_binding_opt : 'a t ‑> (key * 'a) option

Safe version of min_binding.

  • Since: 1.5
val max_binding_opt : 'a t ‑> (key * 'a) option

Safe version of max_binding.

  • Since: 1.5
val find_opt : key ‑> 'a t ‑> 'a option

Safe version of find.

  • Since: 1.5
val find_first : (key ‑> bool) ‑> 'a t ‑> key * 'a

Find smallest binding satisfying the monotonic predicate. +See Map.S.find_first.

  • Since: 1.5
val find_first_opt : (key ‑> bool) ‑> 'a t ‑> (key * 'a) option

Safe version of find_first.

  • Since: 1.5
val merge_safe : f:(key ‑> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

merge_safe ~f a b merges the maps a and b together.

  • Since: 0.17
val union : (key ‑> 'a ‑> 'a ‑> 'a option) ‑> 'a t ‑> 'a t ‑> 'a t

Union of both maps, using the function to combine bindings +that belong to both inputs.

  • Since: 1.4
val of_seq : (key * 'a) sequence ‑> 'a t

Like of_list.

val add_seq : 'a t ‑> (key * 'a) sequence ‑> 'a t
  • Since: 0.14
val to_seq : 'a t ‑> (key * 'a) sequence
val of_list : (key * 'a) list ‑> 'a t

Build a map from the given list of bindings k_i -> v_i, +added in order using add. +If a key occurs several times, only its last binding +will be present in the result.

val add_list : 'a t ‑> (key * 'a) list ‑> 'a t
  • Since: 0.14
val keys : _ t ‑> key sequence

Iterate on keys only.

  • Since: 0.15
val values : 'a t ‑> 'a sequence

Iterate on values only.

  • Since: 0.15
val to_list : 'a t ‑> (key * 'a) list
val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠arrow:string ‑> ?⁠sep:string ‑> key printer ‑> 'a printer ‑> 'a t printer
\ No newline at end of file diff --git a/2.3/containers/CCMixmap/.jbuilder-keep b/2.3/containers/CCMixmap/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCMixmap/Make/argument-1-X/index.html b/2.3/containers/CCMixmap/Make/argument-1-X/index.html new file mode 100644 index 00000000..cb749597 --- /dev/null +++ b/2.3/containers/CCMixmap/Make/argument-1-X/index.html @@ -0,0 +1,2 @@ + +1-X (containers.CCMixmap.Make.1-X)

Parameter CCMixmap.Make.1-X

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCMixmap/Make/index.html b/2.3/containers/CCMixmap/Make/index.html new file mode 100644 index 00000000..957ff0f2 --- /dev/null +++ b/2.3/containers/CCMixmap/Make/index.html @@ -0,0 +1,4 @@ + +Make (containers.CCMixmap.Make)

Module CCMixmap.Make

Parameters

X : ORD

Signature

type key = X.t
type t

A map containing values of different types, indexed by key.

val empty : t

Empty map.

val get : inj:'a injection ‑> key ‑> t ‑> 'a option

Get the value corresponding to this key, if it exists and +belongs to the same key.

val add : inj:'a injection ‑> key ‑> 'a ‑> t ‑> t

Bind the key to the value, using inj.

val find : inj:'a injection ‑> key ‑> t ‑> 'a

Find the value for the given key, which must be of the right type.

  • Raises Not_found: if either the key is not found, or if its value +doesn't belong to the right type.
val cardinal : t ‑> int

Number of bindings.

val remove : key ‑> t ‑> t

Remove the binding for this key.

val mem : inj:_ injection ‑> key ‑> t ‑> bool

Is the given key in the map, with the right type?

val iter_keys : f:(key ‑> unit) ‑> t ‑> unit

Iterate on the keys of this map.

val fold_keys : f:('a ‑> key ‑> 'a) ‑> x:'a ‑> t ‑> 'a

Fold over the keys.

Iterators

type 'a sequence = ('a ‑> unit) ‑> unit
val keys_seq : t ‑> key sequence

All the keys.

val bindings_of : inj:'a injection ‑> t ‑> (key * 'a) sequence

All the bindings that come from the corresponding injection.

type value =
| Value : ('a injection ‑> 'a option) ‑> value
val bindings : t ‑> (key * value) sequence

Iterate on all bindings.

\ No newline at end of file diff --git a/2.3/containers/CCMixmap/index.html b/2.3/containers/CCMixmap/index.html new file mode 100644 index 00000000..a6ac516a --- /dev/null +++ b/2.3/containers/CCMixmap/index.html @@ -0,0 +1,25 @@ + +CCMixmap (containers.CCMixmap)

Module CCMixmap

Maps with Heterogeneous Values

status: experimental

      module M = CCMixmap.Make(CCInt)
+
+      let inj_int = CCMixmap.create_inj()
+      let inj_str = CCMixmap.create_inj()
+      let inj_list_int = CCMixmap.create_inj()
+
+      let m =
+        M.empty
+        |> M.add ~inj:inj_int 1 1
+        |> M.add ~inj:inj_str 2 "2"
+        |> M.add ~inj:inj_list_int 3 [3;3;3]
+
+          assert (M.get ~inj:inj_int 1 m = Some 1)
+          assert (M.get ~inj:inj_str 1 m = None)
+          assert (M.get ~inj:inj_str 2 m = Some "2")
+          assert (M.get ~inj:inj_int 2 m = None)
+          assert (M.get ~inj:inj_list_int 3 m = Some [3;3;3])
+          assert (M.get ~inj:inj_str 3 m = None)

change of API, the map is last argument to make piping with |> easier since 0.16.

type 'a injection

An accessor for values of type 'a in any map. Values put +in the map using a key can only be retrieved using this +very same key.

val create_inj : unit ‑> 'a injection

Return a value that works for a given type of values. This function is +normally called once for each type of value. Several keys may be +created for the same type, but a value set with a given setter can only be +retrieved with the matching getter. The same key can be reused +across multiple maps (although not in a thread-safe way).

module type S : sig ... end
module type ORD : sig ... end
module Make : functor (X : ORD) -> S with type key = X.t
\ No newline at end of file diff --git a/2.3/containers/CCMixmap/module-type-ORD/index.html b/2.3/containers/CCMixmap/module-type-ORD/index.html new file mode 100644 index 00000000..3ec8f62f --- /dev/null +++ b/2.3/containers/CCMixmap/module-type-ORD/index.html @@ -0,0 +1,2 @@ + +ORD (containers.CCMixmap.ORD)

Module type CCMixmap.ORD

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCMixmap/module-type-S/index.html b/2.3/containers/CCMixmap/module-type-S/index.html new file mode 100644 index 00000000..703d77f5 --- /dev/null +++ b/2.3/containers/CCMixmap/module-type-S/index.html @@ -0,0 +1,4 @@ + +S (containers.CCMixmap.S)

Module type CCMixmap.S

type key
type t

A map containing values of different types, indexed by key.

val empty : t

Empty map.

val get : inj:'a injection ‑> key ‑> t ‑> 'a option

Get the value corresponding to this key, if it exists and +belongs to the same key.

val add : inj:'a injection ‑> key ‑> 'a ‑> t ‑> t

Bind the key to the value, using inj.

val find : inj:'a injection ‑> key ‑> t ‑> 'a

Find the value for the given key, which must be of the right type.

  • Raises Not_found: if either the key is not found, or if its value +doesn't belong to the right type.
val cardinal : t ‑> int

Number of bindings.

val remove : key ‑> t ‑> t

Remove the binding for this key.

val mem : inj:_ injection ‑> key ‑> t ‑> bool

Is the given key in the map, with the right type?

val iter_keys : f:(key ‑> unit) ‑> t ‑> unit

Iterate on the keys of this map.

val fold_keys : f:('a ‑> key ‑> 'a) ‑> x:'a ‑> t ‑> 'a

Fold over the keys.

Iterators

type 'a sequence = ('a ‑> unit) ‑> unit
val keys_seq : t ‑> key sequence

All the keys.

val bindings_of : inj:'a injection ‑> t ‑> (key * 'a) sequence

All the bindings that come from the corresponding injection.

type value =
| Value : ('a injection ‑> 'a option) ‑> value
val bindings : t ‑> (key * value) sequence

Iterate on all bindings.

\ No newline at end of file diff --git a/2.3/containers/CCMixset/.jbuilder-keep b/2.3/containers/CCMixset/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCMixset/index.html b/2.3/containers/CCMixset/index.html new file mode 100644 index 00000000..dd899ddc --- /dev/null +++ b/2.3/containers/CCMixset/index.html @@ -0,0 +1,17 @@ + +CCMixset (containers.CCMixset)

Module CCMixset

Set of Heterogeneous Values

      let k1 : int key = newkey () in
+      let k2 : int key = newkey () in
+      let k3 : string key = newkey () in
+      let set =
+        empty
+        |> set ~key:k1 1
+        |> set ~key:k2 2
+        |> set ~key:k3 "3"
+      in
+      assert (get ~key:k1 set = Some 1);
+      assert (get ~key:k2 set = Some 2);
+      assert (get ~key:k3 set = Some "3");
+      ()
type t

A set of values of heterogeneous types

type 'a key

A unique "key" to access a value of type 'a in a set

val newkey : unit ‑> 'a key

newkey () creates a new unique key that can be used to access +a 'a value in a set. Each key created with newkey is distinct +from any other key, even if they have the same type.

Not thread-safe.

val empty : t

Empty set.

val set : key:'a key ‑> 'a ‑> t ‑> t

set ~key v set maps key to v in set. It means that +for every set, get ~key (set ~key v set) = Some v.

val get : key:'a key ‑> t ‑> 'a option

get ~key set obtains the value for key in set, if any.

val get_exn : key:'a key ‑> t ‑> 'a

Same as get, but can fail.

  • Raises Not_found: if the key is not present.
val cardinal : t ‑> int

Number of mappings.

\ No newline at end of file diff --git a/2.3/containers/CCMixtbl/.jbuilder-keep b/2.3/containers/CCMixtbl/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCMixtbl/index.html b/2.3/containers/CCMixtbl/index.html new file mode 100644 index 00000000..d0bc0111 --- /dev/null +++ b/2.3/containers/CCMixtbl/index.html @@ -0,0 +1,32 @@ + +CCMixtbl (containers.CCMixtbl)

Module CCMixtbl

Hash Table with Heterogeneous Keys

From https://github.com/mjambon/mixtbl (thanks to him). +Example:

      let inj_int = CCMixtbl.create_inj () ;;
+
+      let tbl = CCMixtbl.create 10 ;;
+
+      OUnit.assert_equal None (CCMixtbl.get ~inj:inj_int tbl "a");;
+
+      CCMixtbl.set inj_int tbl "a" 1;;
+
+      OUnit.assert_equal (Some 1) (CCMixtbl.get ~inj:inj_int tbl "a");;
+
+      let inj_string = CCMixtbl.create_inj () ;;
+
+      CCMixtbl.set inj_string tbl "b" "Hello";
+
+      OUnit.assert_equal (Some "Hello") (CCMixtbl.get inj_string tbl "b");;
+      OUnit.assert_equal None (CCMixtbl.get inj_string tbl "a");;
+      OUnit.assert_equal (Some 1) (CCMixtbl.get inj_int tbl "a");;
+      CCMixtbl.set inj_string tbl "a" "Bye";;
+
+      OUnit.assert_equal None (CCMixtbl.get inj_int tbl "a");;
+      OUnit.assert_equal (Some "Bye") (CCMixtbl.get inj_string tbl "a");;
type 'a t

A hash table containing values of different types. +The type parameter 'a represents the type of the keys.

type 'b injection

An accessor for values of type 'b in any table. Values put +in the table using a key can only be retrieved using this +very same key.

val create : int ‑> 'a t

create n creates a hash table of initial size n.

val create_inj : unit ‑> 'b injection

Return a value that works for a given type of values. This function is +normally called once for each type of value. Several keys may be +created for the same type, but a value set with a given setter can only be +retrieved with the matching getter. The same key can be reused +across multiple tables (although not in a thread-safe way).

val get : inj:'b injection ‑> 'a t ‑> 'a ‑> 'b option

Get the value corresponding to this key, if it exists and +belongs to the same key.

val set : inj:'b injection ‑> 'a t ‑> 'a ‑> 'b ‑> unit

Bind the key to the value, using inj.

val find : inj:'b injection ‑> 'a t ‑> 'a ‑> 'b

Find the value for the given key, which must be of the right type.

  • Raises Not_found: if either the key is not found, or if its value +doesn't belong to the right type.
val length : 'a t ‑> int

Number of bindings.

val clear : 'a t ‑> unit

Clear content of the hashtable.

val remove : 'a t ‑> 'a ‑> unit

Remove the binding for this key.

val copy : 'a t ‑> 'a t

Copy of the table.

val mem : inj:_ injection ‑> 'a t ‑> 'a ‑> bool

Is the given key in the table, with the right type?

val iter_keys : 'a t ‑> ('a ‑> unit) ‑> unit

Iterate on the keys of this table.

val fold_keys : 'a t ‑> 'b ‑> ('b ‑> 'a ‑> 'b) ‑> 'b

Fold over the keys.

Iterators

type 'a sequence = ('a ‑> unit) ‑> unit
val keys_seq : 'a t ‑> 'a sequence

All the keys.

val bindings_of : inj:'b injection ‑> 'a t ‑> ('a * 'b) sequence

All the bindings that come from the corresponding injection.

type value =
| Value : ('b injection ‑> 'b option) ‑> value
val bindings : 'a t ‑> ('a * value) sequence

Iterate on all bindings.

\ No newline at end of file diff --git a/2.3/containers/CCMonomorphic/.jbuilder-keep b/2.3/containers/CCMonomorphic/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCMonomorphic/index.html b/2.3/containers/CCMonomorphic/index.html new file mode 100644 index 00000000..00170285 --- /dev/null +++ b/2.3/containers/CCMonomorphic/index.html @@ -0,0 +1,2 @@ + +CCMonomorphic (containers.CCMonomorphic)

Module CCMonomorphic

Shadow unsafe functions and operators from Pervasives

val (=) : int ‑> int ‑> bool
val (<>) : int ‑> int ‑> bool
val (<) : int ‑> int ‑> bool
val (>) : int ‑> int ‑> bool
val (<=) : int ‑> int ‑> bool
val (>=) : int ‑> int ‑> bool
val compare : int ‑> int ‑> int
val min : int ‑> int ‑> int
val max : int ‑> int ‑> int

Infix operators for Floats

val (=.) : float ‑> float ‑> bool
  • Since: 2.1
val (<>.) : float ‑> float ‑> bool
  • Since: 2.1
val (<.) : float ‑> float ‑> bool
  • Since: 2.1
val (>.) : float ‑> float ‑> bool
  • Since: 2.1
val (<=.) : float ‑> float ‑> bool
  • Since: 2.1
val (>=.) : float ‑> float ‑> bool
  • Since: 2.1

Shadow Dangerous Operators

val (==) : [ `Consider_using_CCEqual_physical ]
  • Deprecated Please use CCEqual.physical or Pervasives.(==) instead.
val (!=) : [ `Consider_using_CCEqual_physical ]
  • Since: 2.1
  • Deprecated Please use [not CCEqual.physical] or Pervasives.(!=) instead.
\ No newline at end of file diff --git a/2.3/containers/CCMultiMap/.jbuilder-keep b/2.3/containers/CCMultiMap/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCMultiMap/Make/argument-1-K/index.html b/2.3/containers/CCMultiMap/Make/argument-1-K/index.html new file mode 100644 index 00000000..30426542 --- /dev/null +++ b/2.3/containers/CCMultiMap/Make/argument-1-K/index.html @@ -0,0 +1,2 @@ + +1-K (containers.CCMultiMap.Make.1-K)

Parameter CCMultiMap.Make.1-K

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCMultiMap/Make/argument-2-V/index.html b/2.3/containers/CCMultiMap/Make/argument-2-V/index.html new file mode 100644 index 00000000..d8663848 --- /dev/null +++ b/2.3/containers/CCMultiMap/Make/argument-2-V/index.html @@ -0,0 +1,2 @@ + +2-V (containers.CCMultiMap.Make.2-V)

Parameter CCMultiMap.Make.2-V

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCMultiMap/Make/index.html b/2.3/containers/CCMultiMap/Make/index.html new file mode 100644 index 00000000..6e698cd0 --- /dev/null +++ b/2.3/containers/CCMultiMap/Make/index.html @@ -0,0 +1,3 @@ + +Make (containers.CCMultiMap.Make)

Module CCMultiMap.Make

Parameters

Signature

type key = K.t
type value = V.t
type t
val empty : t

Empty multimap.

val is_empty : t ‑> bool

Empty multimap?

val add : t ‑> key ‑> value ‑> t

Add a key/value binding.

val remove : t ‑> key ‑> value ‑> t

Remove the binding.

val remove_all : t ‑> key ‑> t

Remove the key from the map.

val mem : t ‑> key ‑> bool

Is there a binding for this key?

val find : t ‑> key ‑> value list

List of values for this key.

val find_iter : t ‑> key ‑> (value ‑> unit) ‑> unit

Iterate on bindings for this key.

val count : t ‑> key ‑> int

Number of bindings for this key.

val iter : t ‑> (key ‑> value ‑> unit) ‑> unit

Iterate on all key/value.

val fold : t ‑> 'a ‑> ('a ‑> key ‑> value ‑> 'a) ‑> 'a

Fold on all key/value.

val size : t ‑> int

Number of keys.

val union : t ‑> t ‑> t

Union of multimaps.

val inter : t ‑> t ‑> t

Intersection of multimaps.

val diff : t ‑> t ‑> t

Difference of maps, i.e. bindings of the first that are not +in the second.

val equal : t ‑> t ‑> bool

Same multimap.

val compare : t ‑> t ‑> int

Total order on multimaps.

val submap : t ‑> t ‑> bool

submap m1 m2 is true iff all bindings of m1 are also in m2.

val to_seq : t ‑> (key * value) sequence
val of_seq : ?⁠init:t ‑> (key * value) sequence ‑> t
val keys : t ‑> key sequence
val values : t ‑> value sequence

Some values may occur several times.

\ No newline at end of file diff --git a/2.3/containers/CCMultiMap/MakeBidir/argument-1-L/index.html b/2.3/containers/CCMultiMap/MakeBidir/argument-1-L/index.html new file mode 100644 index 00000000..f6bdb159 --- /dev/null +++ b/2.3/containers/CCMultiMap/MakeBidir/argument-1-L/index.html @@ -0,0 +1,2 @@ + +1-L (containers.CCMultiMap.MakeBidir.1-L)

Parameter CCMultiMap.MakeBidir.1-L

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCMultiMap/MakeBidir/argument-2-R/index.html b/2.3/containers/CCMultiMap/MakeBidir/argument-2-R/index.html new file mode 100644 index 00000000..6deb89ff --- /dev/null +++ b/2.3/containers/CCMultiMap/MakeBidir/argument-2-R/index.html @@ -0,0 +1,2 @@ + +2-R (containers.CCMultiMap.MakeBidir.2-R)

Parameter CCMultiMap.MakeBidir.2-R

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCMultiMap/MakeBidir/index.html b/2.3/containers/CCMultiMap/MakeBidir/index.html new file mode 100644 index 00000000..841c67f3 --- /dev/null +++ b/2.3/containers/CCMultiMap/MakeBidir/index.html @@ -0,0 +1,2 @@ + +MakeBidir (containers.CCMultiMap.MakeBidir)

Module CCMultiMap.MakeBidir

Parameters

Signature

type t
type left = L.t
type right = R.t
val empty : t
val is_empty : t ‑> bool
val add : t ‑> left ‑> right ‑> t

Add a binding (left,right).

val remove : t ‑> left ‑> right ‑> t

Remove a specific binding.

val cardinal_left : t ‑> int

Number of distinct left keys.

val cardinal_right : t ‑> int

Number of distinct right keys.

val remove_left : t ‑> left ‑> t

Remove all bindings for the left key.

val remove_right : t ‑> right ‑> t

Remove all bindings for the right key.

val mem_left : t ‑> left ‑> bool

Is the left key present in at least one pair?

val mem_right : t ‑> right ‑> bool

Is the right key present in at least one pair?

val find_left : t ‑> left ‑> right sequence

Find all bindings for this given left-key.

val find_right : t ‑> right ‑> left sequence

Find all bindings for this given right-key.

val find1_left : t ‑> left ‑> right option

Like find_left but returns at most one value.

val find1_right : t ‑> right ‑> left option

Like find_right but returns at most one value.

val fold : ('a ‑> left ‑> right ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on pairs.

val pairs : t ‑> (left * right) sequence

Iterate on pairs.

val add_pairs : t ‑> (left * right) sequence ‑> t

Add pairs.

val seq_left : t ‑> left sequence
val seq_right : t ‑> right sequence
\ No newline at end of file diff --git a/2.3/containers/CCMultiMap/index.html b/2.3/containers/CCMultiMap/index.html new file mode 100644 index 00000000..a17026e4 --- /dev/null +++ b/2.3/containers/CCMultiMap/index.html @@ -0,0 +1,4 @@ + +CCMultiMap (containers.CCMultiMap)

Module CCMultiMap

Multimap

type 'a sequence = ('a ‑> unit) ‑> unit
module type S : sig ... end
module type OrderedType : sig ... end
module Make : functor (K : OrderedType) -> functor (V : OrderedType) -> S with type key = K.t and type value = V.t

Two-Way Multimap

+Represents n-to-n mappings between two types. Each element from the "left" +is mapped to several right values, and conversely.

module type BIDIR : sig ... end
module MakeBidir : functor (L : OrderedType) -> functor (R : OrderedType) -> BIDIR with type left = L.t and type right = R.t
\ No newline at end of file diff --git a/2.3/containers/CCMultiMap/module-type-BIDIR/index.html b/2.3/containers/CCMultiMap/module-type-BIDIR/index.html new file mode 100644 index 00000000..f1223551 --- /dev/null +++ b/2.3/containers/CCMultiMap/module-type-BIDIR/index.html @@ -0,0 +1,2 @@ + +BIDIR (containers.CCMultiMap.BIDIR)

Module type CCMultiMap.BIDIR

type t
type left
type right
val empty : t
val is_empty : t ‑> bool
val add : t ‑> left ‑> right ‑> t

Add a binding (left,right).

val remove : t ‑> left ‑> right ‑> t

Remove a specific binding.

val cardinal_left : t ‑> int

Number of distinct left keys.

val cardinal_right : t ‑> int

Number of distinct right keys.

val remove_left : t ‑> left ‑> t

Remove all bindings for the left key.

val remove_right : t ‑> right ‑> t

Remove all bindings for the right key.

val mem_left : t ‑> left ‑> bool

Is the left key present in at least one pair?

val mem_right : t ‑> right ‑> bool

Is the right key present in at least one pair?

val find_left : t ‑> left ‑> right sequence

Find all bindings for this given left-key.

val find_right : t ‑> right ‑> left sequence

Find all bindings for this given right-key.

val find1_left : t ‑> left ‑> right option

Like find_left but returns at most one value.

val find1_right : t ‑> right ‑> left option

Like find_right but returns at most one value.

val fold : ('a ‑> left ‑> right ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on pairs.

val pairs : t ‑> (left * right) sequence

Iterate on pairs.

val add_pairs : t ‑> (left * right) sequence ‑> t

Add pairs.

val seq_left : t ‑> left sequence
val seq_right : t ‑> right sequence
\ No newline at end of file diff --git a/2.3/containers/CCMultiMap/module-type-OrderedType/index.html b/2.3/containers/CCMultiMap/module-type-OrderedType/index.html new file mode 100644 index 00000000..084c5146 --- /dev/null +++ b/2.3/containers/CCMultiMap/module-type-OrderedType/index.html @@ -0,0 +1,2 @@ + +OrderedType (containers.CCMultiMap.OrderedType)

Module type CCMultiMap.OrderedType

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCMultiMap/module-type-S/index.html b/2.3/containers/CCMultiMap/module-type-S/index.html new file mode 100644 index 00000000..89e5faec --- /dev/null +++ b/2.3/containers/CCMultiMap/module-type-S/index.html @@ -0,0 +1,3 @@ + +S (containers.CCMultiMap.S)

Module type CCMultiMap.S

type key
type value
type t
val empty : t

Empty multimap.

val is_empty : t ‑> bool

Empty multimap?

val add : t ‑> key ‑> value ‑> t

Add a key/value binding.

val remove : t ‑> key ‑> value ‑> t

Remove the binding.

val remove_all : t ‑> key ‑> t

Remove the key from the map.

val mem : t ‑> key ‑> bool

Is there a binding for this key?

val find : t ‑> key ‑> value list

List of values for this key.

val find_iter : t ‑> key ‑> (value ‑> unit) ‑> unit

Iterate on bindings for this key.

val count : t ‑> key ‑> int

Number of bindings for this key.

val iter : t ‑> (key ‑> value ‑> unit) ‑> unit

Iterate on all key/value.

val fold : t ‑> 'a ‑> ('a ‑> key ‑> value ‑> 'a) ‑> 'a

Fold on all key/value.

val size : t ‑> int

Number of keys.

val union : t ‑> t ‑> t

Union of multimaps.

val inter : t ‑> t ‑> t

Intersection of multimaps.

val diff : t ‑> t ‑> t

Difference of maps, i.e. bindings of the first that are not +in the second.

val equal : t ‑> t ‑> bool

Same multimap.

val compare : t ‑> t ‑> int

Total order on multimaps.

val submap : t ‑> t ‑> bool

submap m1 m2 is true iff all bindings of m1 are also in m2.

val to_seq : t ‑> (key * value) sequence
val of_seq : ?⁠init:t ‑> (key * value) sequence ‑> t
val keys : t ‑> key sequence
val values : t ‑> value sequence

Some values may occur several times.

\ No newline at end of file diff --git a/2.3/containers/CCMultiSet/.jbuilder-keep b/2.3/containers/CCMultiSet/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCMultiSet/Make/index.html b/2.3/containers/CCMultiSet/Make/index.html new file mode 100644 index 00000000..6c21b12a --- /dev/null +++ b/2.3/containers/CCMultiSet/Make/index.html @@ -0,0 +1,8 @@ + +Make (containers.CCMultiSet.Make)

Module CCMultiSet.Make

Parameters

O : Set.OrderedType

Signature

type elt = O.t
type t
val empty : t
val is_empty : t ‑> bool
val mem : t ‑> elt ‑> bool
val count : t ‑> elt ‑> int
val singleton : elt ‑> t
val add : t ‑> elt ‑> t
val remove : t ‑> elt ‑> t
val add_mult : t ‑> elt ‑> int ‑> t

add_mult set x n adds n occurrences of x to set.

  • Raises Invalid_argument: if n < 0.
  • Since: 0.6
val remove_mult : t ‑> elt ‑> int ‑> t

remove_mult set x n removes at most n occurrences of x from set.

  • Raises Invalid_argument: if n < 0.
  • Since: 0.6
val remove_all : t ‑> elt ‑> t

remove_all set x removes all occurrences of x from set.

  • Since: 0.22
val update : t ‑> elt ‑> (int ‑> int) ‑> t

update set x f calls f n where n is the current multiplicity +of x in set (0 to indicate its absence); the result of f n +is the new multiplicity of x.

  • Raises Invalid_argument: if f n < 0.
  • Since: 0.6
val min : t ‑> elt

Minimal element w.r.t the total ordering on elements.

val max : t ‑> elt

Maximal element w.r.t the total ordering on elements.

val union : t ‑> t ‑> t

union a b contains as many occurrences of an element x +as count a x + count b x.

val meet : t ‑> t ‑> t

meet a b is a multiset such that +count (meet a b) x = max (count a x) (count b x).

val intersection : t ‑> t ‑> t

intersection a b is a multiset such that +count (intersection a b) x = min (count a x) (count b x).

val diff : t ‑> t ‑> t

MultiSet difference. +count (diff a b) x = max (count a x - count b x) 0.

val contains : t ‑> t ‑> bool

contains a x = (count m x > 0).

val compare : t ‑> t ‑> int
val equal : t ‑> t ‑> bool
val cardinal : t ‑> int

Number of distinct elements.

val iter : t ‑> (int ‑> elt ‑> unit) ‑> unit
val fold : t ‑> 'b ‑> ('b ‑> int ‑> elt ‑> 'b) ‑> 'b
val of_list : elt list ‑> t
val to_list : t ‑> elt list
val to_seq : t ‑> elt sequence
val of_seq : elt sequence ‑> t
val of_list_mult : (elt * int) list ‑> t
  • Since: 0.19
val to_list_mult : t ‑> (elt * int) list
  • Since: 0.19
val to_seq_mult : t ‑> (elt * int) sequence
  • Since: 0.19
val of_seq_mult : (elt * int) sequence ‑> t
  • Since: 0.19
\ No newline at end of file diff --git a/2.3/containers/CCMultiSet/index.html b/2.3/containers/CCMultiSet/index.html new file mode 100644 index 00000000..ed143fa4 --- /dev/null +++ b/2.3/containers/CCMultiSet/index.html @@ -0,0 +1,2 @@ + +CCMultiSet (containers.CCMultiSet)

Module CCMultiSet

Multiset

type 'a sequence = ('a ‑> unit) ‑> unit
module type S : sig ... end
module Make : functor (O : Set.OrderedType) -> S with type elt = O.t
\ No newline at end of file diff --git a/2.3/containers/CCMultiSet/module-type-S/index.html b/2.3/containers/CCMultiSet/module-type-S/index.html new file mode 100644 index 00000000..87901cb7 --- /dev/null +++ b/2.3/containers/CCMultiSet/module-type-S/index.html @@ -0,0 +1,8 @@ + +S (containers.CCMultiSet.S)

Module type CCMultiSet.S

type elt
type t
val empty : t
val is_empty : t ‑> bool
val mem : t ‑> elt ‑> bool
val count : t ‑> elt ‑> int
val singleton : elt ‑> t
val add : t ‑> elt ‑> t
val remove : t ‑> elt ‑> t
val add_mult : t ‑> elt ‑> int ‑> t

add_mult set x n adds n occurrences of x to set.

  • Raises Invalid_argument: if n < 0.
  • Since: 0.6
val remove_mult : t ‑> elt ‑> int ‑> t

remove_mult set x n removes at most n occurrences of x from set.

  • Raises Invalid_argument: if n < 0.
  • Since: 0.6
val remove_all : t ‑> elt ‑> t

remove_all set x removes all occurrences of x from set.

  • Since: 0.22
val update : t ‑> elt ‑> (int ‑> int) ‑> t

update set x f calls f n where n is the current multiplicity +of x in set (0 to indicate its absence); the result of f n +is the new multiplicity of x.

  • Raises Invalid_argument: if f n < 0.
  • Since: 0.6
val min : t ‑> elt

Minimal element w.r.t the total ordering on elements.

val max : t ‑> elt

Maximal element w.r.t the total ordering on elements.

val union : t ‑> t ‑> t

union a b contains as many occurrences of an element x +as count a x + count b x.

val meet : t ‑> t ‑> t

meet a b is a multiset such that +count (meet a b) x = max (count a x) (count b x).

val intersection : t ‑> t ‑> t

intersection a b is a multiset such that +count (intersection a b) x = min (count a x) (count b x).

val diff : t ‑> t ‑> t

MultiSet difference. +count (diff a b) x = max (count a x - count b x) 0.

val contains : t ‑> t ‑> bool

contains a x = (count m x > 0).

val compare : t ‑> t ‑> int
val equal : t ‑> t ‑> bool
val cardinal : t ‑> int

Number of distinct elements.

val iter : t ‑> (int ‑> elt ‑> unit) ‑> unit
val fold : t ‑> 'b ‑> ('b ‑> int ‑> elt ‑> 'b) ‑> 'b
val of_list : elt list ‑> t
val to_list : t ‑> elt list
val to_seq : t ‑> elt sequence
val of_seq : elt sequence ‑> t
val of_list_mult : (elt * int) list ‑> t
  • Since: 0.19
val to_list_mult : t ‑> (elt * int) list
  • Since: 0.19
val to_seq_mult : t ‑> (elt * int) sequence
  • Since: 0.19
val of_seq_mult : (elt * int) sequence ‑> t
  • Since: 0.19
\ No newline at end of file diff --git a/2.3/containers/CCNativeint/.jbuilder-keep b/2.3/containers/CCNativeint/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCNativeint/Infix/index.html b/2.3/containers/CCNativeint/Infix/index.html new file mode 100644 index 00000000..48c1b56c --- /dev/null +++ b/2.3/containers/CCNativeint/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCNativeint.Infix)

Module CCNativeint.Infix

val (+) : t ‑> t ‑> t
val (-) : t ‑> t ‑> t
val (~-) : t ‑> t
val (*) : t ‑> t ‑> t
val (/) : t ‑> t ‑> t
val (mod) : t ‑> t ‑> t
val (land) : t ‑> t ‑> t
val (lor) : t ‑> t ‑> t
val (lxor) : t ‑> t ‑> t
val (lnot) : t ‑> t
val (lsl) : t ‑> int ‑> t
val (lsr) : t ‑> int ‑> t
val (asr) : t ‑> int ‑> t
val (=) : t ‑> t ‑> bool
val (<>) : t ‑> t ‑> bool
val (>) : t ‑> t ‑> bool
val (>=) : t ‑> t ‑> bool
val (<=) : t ‑> t ‑> bool
val (<) : t ‑> t ‑> bool
\ No newline at end of file diff --git a/2.3/containers/CCNativeint/index.html b/2.3/containers/CCNativeint/index.html new file mode 100644 index 00000000..57ac31f8 --- /dev/null +++ b/2.3/containers/CCNativeint/index.html @@ -0,0 +1,40 @@ + +CCNativeint (containers.CCNativeint)

Module CCNativeint

Nativeint

Helpers for processor-native integers

This module provides operations on the type nativeint of signed 32-bit integers +(on 32-bit platforms) or signed 64-bit integers (on 64-bit platforms). +This integer type has exactly the same width as that of a pointer type in the C compiler. +All arithmetic operations over nativeint are taken modulo 232 or 264 depending +on the word size of the architecture.

Performance notice: values of type nativeint occupy more memory space than values of type int, +and arithmetic operations on nativeint are generally slower than those on int. +Use nativeint only when the application requires the extra bit of precision over the int type.

include module type of sig ... end
val zero : nativeint
val one : nativeint
val minus_one : nativeint
external neg : nativeint ‑> nativeint = "%nativeint_neg"
external add : nativeint ‑> nativeint ‑> nativeint = "%nativeint_add"
external sub : nativeint ‑> nativeint ‑> nativeint = "%nativeint_sub"
external mul : nativeint ‑> nativeint ‑> nativeint = "%nativeint_mul"
external div : nativeint ‑> nativeint ‑> nativeint = "%nativeint_div"
external rem : nativeint ‑> nativeint ‑> nativeint = "%nativeint_mod"
val succ : nativeint ‑> nativeint
val pred : nativeint ‑> nativeint
val abs : nativeint ‑> nativeint
val size : int
val max_int : nativeint
val min_int : nativeint
external logand : nativeint ‑> nativeint ‑> nativeint = "%nativeint_and"
external logor : nativeint ‑> nativeint ‑> nativeint = "%nativeint_or"
external logxor : nativeint ‑> nativeint ‑> nativeint = "%nativeint_xor"
val lognot : nativeint ‑> nativeint
external shift_left : nativeint ‑> int ‑> nativeint = "%nativeint_lsl"
external shift_right : nativeint ‑> int ‑> nativeint = "%nativeint_asr"
external shift_right_logical : nativeint ‑> int ‑> nativeint = "%nativeint_lsr"
external of_int : int ‑> nativeint = "%nativeint_of_int"
external to_int : nativeint ‑> int = "%nativeint_to_int"
external of_float : float ‑> nativeint = "caml_nativeint_of_float" "caml_nativeint_of_float_unboxed"
external to_float : nativeint ‑> float = "caml_nativeint_to_float" "caml_nativeint_to_float_unboxed"
external of_int32 : int32 ‑> nativeint = "%nativeint_of_int32"
external to_int32 : nativeint ‑> int32 = "%nativeint_to_int32"
external of_string : string ‑> nativeint = "caml_nativeint_of_string"
val of_string_opt : string ‑> nativeint option
val to_string : nativeint ‑> string
type t = nativeint
val compare : t ‑> t ‑> int
val equal : t ‑> t ‑> bool
external format : string ‑> nativeint ‑> string = "caml_nativeint_format"
val (+) : t ‑> t ‑> t

Addition.

val (-) : t ‑> t ‑> t

Subtraction.

val (~-) : t ‑> t

Unary negation.

val (*) : t ‑> t ‑> t

Multiplication.

val (/) : t ‑> t ‑> t

Integer division. Raise Division_by_zero if the second +argument is zero. This division rounds the real quotient of +its arguments towards zero, as specified for Pervasives.(/).

val (mod) : t ‑> t ‑> t

x mod y is the integer remainder. +If y <> zero, the result of x mod y satisfies the following properties: +zero <= x mod y < abs y and +x = ((x / y) * y) + (x mod y). +If y = 0, x mod y raises Division_by_zero.

val (land) : t ‑> t ‑> t

Bitwise logical and.

val (lor) : t ‑> t ‑> t

Bitwise logical or.

val (lxor) : t ‑> t ‑> t

Bitwise logical exclusive or.

val (lnot) : t ‑> t

Bitwise logical negation.

val (lsl) : t ‑> int ‑> t

x lsl y shifts x to the left by y bits. +The result is unspecified if y < 0 or y >= bitsize, where bitsize is 32 on a 32-bit platform +and 64 on a 64-bit platform.

val (lsr) : t ‑> int ‑> t

x lsr y shifts x to the right by y bits. +This is a logical shift: zeroes are inserted in the vacated bits +regardless of the sign of x. +The result is unspecified if y < 0 or y >= bitsize.

val (asr) : t ‑> int ‑> t

x asr y shifts x to the right by y bits. +This is an arithmetic shift: the sign bit of x is replicated +and inserted in the vacated bits. +The result is unspecified if y < 0 or y >= bitsize.

module Infix : sig ... end
val equal : t ‑> t ‑> bool

The equal function for native integers. +Like Pervasives.(=) x y).

val hash : t ‑> int

Like Pervasives.abs (to_int x).

Conversion

val to_int : t ‑> int

Convert the given native integer (type nativeint) to an +integer (type int). The high-order bit is lost +during the conversion.

val of_int : int ‑> t

Alias to Nativeint.of_int. +Convert the given integer (type int) to a native integer (type nativeint).

val to_float : t ‑> float

Convert the given native integer to a floating-point number.

val of_float : float ‑> t

Alias to Nativeint.of_float. +Convert the given floating-point number to a native integer, +discarding the fractional part (truncate towards 0). +The result of the conversion is undefined if, after truncation, the number +is outside the range [CCNativeint.min_int, CCNativeint.max_int].

val to_string : t ‑> string

Return the string representation of its argument, in decimal.

val of_string_exn : string ‑> t

Alias to Nativeint.of_string. +Convert the given string to a native integer. +The string is read in decimal (by default, or if the string +begins with 0u) or in hexadecimal, octal or binary if the +string begins with 0x, 0o or 0b respectively.

The 0u prefix reads the input as an unsigned integer in the range +[0, 2*CCNativeint.max_int+1]. If the input exceeds CCNativeint.max_int +it is converted to the signed integer +CCInt64.min_int + input - CCNativeint.max_int - 1.

Raise Failure "Nativeint.of_string" if the given string is not +a valid representation of an integer, or if the integer represented +exceeds the range of integers representable in type nativeint.

val of_string : string ‑> t option

Safe version of of_string_exn. +Like of_string_exn, but return None instead of raising.

val of_string_opt : string ‑> t option

Alias to of_string.

\ No newline at end of file diff --git a/2.3/containers/CCOpt/.jbuilder-keep b/2.3/containers/CCOpt/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCOpt/Infix/index.html b/2.3/containers/CCOpt/Infix/index.html new file mode 100644 index 00000000..e64cbeba --- /dev/null +++ b/2.3/containers/CCOpt/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCOpt.Infix)

Module CCOpt.Infix

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

x >|= f is map f x.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind.

val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

f <*> (Some x) returns Some (f x) and f <*> None returns None.

val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Like map.

val (<+>) : 'a t ‑> 'a t ‑> 'a t

a <+> b is a if a is Some _, b otherwise.

\ No newline at end of file diff --git a/2.3/containers/CCOpt/index.html b/2.3/containers/CCOpt/index.html new file mode 100644 index 00000000..48499874 --- /dev/null +++ b/2.3/containers/CCOpt/index.html @@ -0,0 +1,12 @@ + +CCOpt (containers.CCOpt)

Module CCOpt

Options

type +'a t = 'a option
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Transform the element inside, if any.

val map_or : default:'b ‑> ('a ‑> 'b) ‑> 'a t ‑> 'b

map_or ~default f o is f x if o = Some x, default otherwise.

  • Since: 0.16
val map_lazy : (unit ‑> 'b) ‑> ('a ‑> 'b) ‑> 'a t ‑> 'b

map_lazy default_fn f o if f o if o = Some x, default_fn () otherwise.

  • Since: 1.2
val is_some : _ t ‑> bool

is_some (Some x) returns true otherwise it returns false.

val is_none : _ t ‑> bool

is_none None returns true otherwise it returns false.

  • Since: 0.11
val compare : ('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a t ‑> int

Compare two options, using custom comparators for the value. +None is always assumed to be less than Some _.

val equal : ('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool

Test for equality between option types using a custom equality predicat.

val return : 'a ‑> 'a t

Monadic return, that is return x = Some x.

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind.

val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b t

Flip version of >>=.

val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t

map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.

val iter : ('a ‑> unit) ‑> 'a t ‑> unit

Iterate on 0 or 1 element.

val fold : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a

Fold on 0 or 1 element.

val filter : ('a ‑> bool) ‑> 'a t ‑> 'a t

Filter on 0 or 1 element.

  • Since: 0.5
val if_ : ('a ‑> bool) ‑> 'a ‑> 'a option

if_ f x is Some x if f x, None otherwise.

  • Since: 0.17
val exists : ('a ‑> bool) ‑> 'a t ‑> bool

Return true iff there exists an element for which the provided function evaluates to true.

  • Since: 0.17
val for_all : ('a ‑> bool) ‑> 'a t ‑> bool

Return true iff the provided function evaluates to true for all elements.

  • Since: 0.17
val get_or : default:'a ‑> 'a t ‑> 'a

get_or ~default o extracts the value from o, or +returns default if o = None.

  • Since: 0.18
val get_exn : 'a t ‑> 'a

Open the option, possibly failing if it is None.

  • Raises Invalid_argument: if the option is None.
val get_lazy : (unit ‑> 'a) ‑> 'a t ‑> 'a

get_lazy default_fn x unwraps x, but if x = None it returns default_fn () instead.

  • Since: 0.6.1
val sequence_l : 'a t list ‑> 'a list t

sequence_l [x1; x2; ...; xn] returns Some [y1;y2;...;yn] if +every xi is Some yi. Otherwise, if the list contains at least +one None, the result is None.

val wrap : ?⁠handler:(exn ‑> bool) ‑> ('a ‑> 'b) ‑> 'a ‑> 'b option

wrap f x calls f x and returns Some y if f x = y. If f x raises +any exception, the result is None. This can be useful to wrap functions +such as Map.S.find.

  • Parameter handler: the exception handler, which returns true if the +exception is to be caught.
val wrap2 : ?⁠handler:(exn ‑> bool) ‑> ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> 'c option

wrap2 f x y is similar to wrap but for binary functions.

Applicative

val pure : 'a ‑> 'a t

Alias to return.

val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

f <*> (Some x) returns Some (f x) and f <*> None returns None.

val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Like map.

Alternatives

val or_ : else_:'a t ‑> 'a t ‑> 'a t

or_ ~else_ a is a if a is Some _, else_ otherwise.

  • Since: 1.2
val or_lazy : else_:(unit ‑> 'a t) ‑> 'a t ‑> 'a t

or_lazy ~else_ a is a if a is Some _, else_ () otherwise.

  • Since: 1.2
val (<+>) : 'a t ‑> 'a t ‑> 'a t

a <+> b is a if a is Some _, b otherwise.

val choice : 'a t list ‑> 'a t

choice returns the first non-None element of the list, or None.

val flatten : 'a t t ‑> 'a t

flatten transforms Some x into x.

  • Since: 2.2
val return_if : bool ‑> 'a ‑> 'a t

Apply Some or None depending on a boolean. +More precisely, return_if false x is None, +and return_if true x is Some x.

  • Since: 2.2

Infix Operators

module Infix : sig ... end

Conversion and IO

val to_list : 'a t ‑> 'a list
val of_list : 'a list ‑> 'a t

Head of list, or None.

val to_result : 'e ‑> 'a t ‑> ('a'e) Result.result
  • Since: 1.2
val to_result_lazy : (unit ‑> 'e) ‑> 'a t ‑> ('a'e) Result.result
  • Since: 1.2
val of_result : ('a_) Result.result ‑> 'a t
  • Since: 1.2
type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a random_gen = Random.State.t ‑> 'a
val random : 'a random_gen ‑> 'a t random_gen
val choice_seq : 'a t sequence ‑> 'a t

choice_seq s is similar to choice, but works on sequences. +It returns the first Some x occurring in s, or None otherwise.

  • Since: 0.13
val to_gen : 'a t ‑> 'a gen
val to_seq : 'a t ‑> 'a sequence
val pp : 'a printer ‑> 'a t printer
\ No newline at end of file diff --git a/2.3/containers/CCOrd/.jbuilder-keep b/2.3/containers/CCOrd/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCOrd/Infix/index.html b/2.3/containers/CCOrd/Infix/index.html new file mode 100644 index 00000000..518312f2 --- /dev/null +++ b/2.3/containers/CCOrd/Infix/index.html @@ -0,0 +1,4 @@ + +Infix (containers.CCOrd.Infix)

Module CCOrd.Infix

val (<?>) : int ‑> ('a t * 'a * 'a) ‑> int

c1 <?> (ord, x, y) returns the same as c1 if c1 is not 0; +otherwise it uses ord to compare the two values x and y, +of type 'a.

val (>|=) : 'b t ‑> ('a ‑> 'b) ‑> 'a t

Infix equivalent of map.

\ No newline at end of file diff --git a/2.3/containers/CCOrd/index.html b/2.3/containers/CCOrd/index.html new file mode 100644 index 00000000..bf28fcc5 --- /dev/null +++ b/2.3/containers/CCOrd/index.html @@ -0,0 +1,15 @@ + +CCOrd (containers.CCOrd)

Module CCOrd

Comparisons

type 'a t = 'a ‑> 'a ‑> int

Comparison (total ordering) between two elements, that returns an int.

val compare : 'a t

Polymorphic "magic" comparison.

val opp : 'a t ‑> 'a t

Opposite order.

val equiv : int ‑> int ‑> bool

Returns true iff the two comparison results are the same.

val int : int t
val string : string t
val bool : bool t
val float : float t

Lexicographic Combination

val (<?>) : int ‑> ('a t * 'a * 'a) ‑> int

c1 <?> (ord, x, y) returns the same as c1 if c1 is not 0; +otherwise it uses ord to compare the two values x and y, +of type 'a.

Example: +

CCInt.compare 1 3
+      <?> (String.compare, "a", "b")
+      <?> (CCBool.compare, true, false)

Same example, using only CCOrd:: +

CCOrd.(int 1 3
+        <?> (string, "a", "b")
+        <?> (bool, true, false))
val option : 'a t ‑> 'a option t

Comparison of optional values. None is smaller than any Some _.

  • Since: 0.15
val pair : 'a t ‑> 'b t ‑> ('a * 'b) t
val triple : 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t
val list : 'a t ‑> 'a list t

Lexicographic combination on lists.

val array : 'a t ‑> 'a array t
val map : ('a ‑> 'b) ‑> 'b t ‑> 'a t

map f ord is the comparison function that, given objects x and y, +projects x and y using f (e.g. using a record field) and then +compares those projections with ord. +Example: +map fst CCInt.compare compares values of type (int * 'a) by their +first component.

val (>|=) : 'b t ‑> ('a ‑> 'b) ‑> 'a t

Infix equivalent of map.

module Infix : sig ... end
\ No newline at end of file diff --git a/2.3/containers/CCPair/.jbuilder-keep b/2.3/containers/CCPair/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCPair/index.html b/2.3/containers/CCPair/index.html new file mode 100644 index 00000000..e236b9aa --- /dev/null +++ b/2.3/containers/CCPair/index.html @@ -0,0 +1,4 @@ + +CCPair (containers.CCPair)

Module CCPair

Tuple Functions

type ('a, 'b) t = 'a * 'b
val make : 'a ‑> 'b ‑> ('a'bt

Make a tuple from its components.

  • Since: 0.16
val map1 : ('a ‑> 'b) ‑> ('a * 'c) ‑> 'b * 'c

map1 f (x, y) returns (f x, y).

val map2 : ('a ‑> 'b) ‑> ('c * 'a) ‑> 'c * 'b

map2 f (x, y) returns (x, f y).

val map : ('a ‑> 'c) ‑> ('b ‑> 'd) ‑> ('a * 'b) ‑> 'c * 'd

Synonym to ( *** ). Map on both sides of a tuple.

val map_same : ('a ‑> 'b) ‑> ('a * 'a) ‑> 'b * 'b

Like map but specialized for pairs with elements of the same type.

val map_fst : ('a ‑> 'b) ‑> ('a * _) ‑> 'b

Compose the given function with fst.

  • Since: 0.3.3
val map_snd : ('a ‑> 'b) ‑> (_ * 'a) ‑> 'b

Compose the given function with snd.

  • Since: 0.3.3
val iter : ('a ‑> 'b ‑> unit) ‑> ('a * 'b) ‑> unit
val swap : ('a * 'b) ‑> 'b * 'a

Swap the components of the tuple.

val (<<<) : ('a ‑> 'b) ‑> ('a * 'c) ‑> 'b * 'c

Map on the left side of the tuple.

val (>>>) : ('a ‑> 'b) ‑> ('c * 'a) ‑> 'c * 'b

Map on the right side of the tuple.

val (***) : ('a ‑> 'c) ‑> ('b ‑> 'd) ‑> ('a * 'b) ‑> 'c * 'd

Map on both sides of a tuple.

val (&&&) : ('a ‑> 'b) ‑> ('a ‑> 'c) ‑> 'a ‑> 'b * 'c

f &&& g is fun x -> f x, g x. It splits the computations into +two parts.

val merge : ('a ‑> 'b ‑> 'c) ‑> ('a * 'b) ‑> 'c

Uncurrying (merges the two components of a tuple).

val fold : ('a ‑> 'b ‑> 'c) ‑> ('a * 'b) ‑> 'c

Synonym to merge.

  • Since: 0.3.3
val dup : 'a ‑> 'a * 'a

dup x = (x,x) (duplicate the value).

  • Since: 0.3.3
val dup_map : ('a ‑> 'b) ‑> 'a ‑> 'a * 'b

dup_map f x = (x, f x). Duplicates the value and applies the function +to the second copy.

  • Since: 0.3.3
val equal : ('a ‑> 'a ‑> bool) ‑> ('b ‑> 'b ‑> bool) ‑> ('a * 'b) ‑> ('a * 'b) ‑> bool
val compare : ('a ‑> 'a ‑> int) ‑> ('b ‑> 'b ‑> int) ‑> ('a * 'b) ‑> ('a * 'b) ‑> int
type 'a printer = Format.formatter ‑> 'a ‑> unit
val pp : ?⁠sep:string ‑> 'a printer ‑> 'b printer ‑> ('a * 'b) printer

Print a pair given an optional separator and a method for printing each of its elements.

\ No newline at end of file diff --git a/2.3/containers/CCParse/.jbuilder-keep b/2.3/containers/CCParse/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCParse/Infix/index.html b/2.3/containers/CCParse/Infix/index.html new file mode 100644 index 00000000..2db2c0dc --- /dev/null +++ b/2.3/containers/CCParse/Infix/index.html @@ -0,0 +1,13 @@ + +Infix (containers.CCParse.Infix)

Module CCParse.Infix

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Map.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind. +p >>= f results in a new parser which behaves as p then, +in case of success, applies f to the result.

val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

Applicative.

val (<*) : 'a t ‑> _ t ‑> 'a t

a <* b parses a into x, parses b and ignores its result, +and returns x.

val (*>) : _ t ‑> 'a t ‑> 'a t

a *> b parses a, then parses b into x, and returns x. The +results of a is ignored.

val (<|>) : 'a t ‑> 'a t ‑> 'a t

a <|> b tries to parse a, and if a fails without +consuming any input, backtracks and tries +to parse b, otherwise it fails as a. +See try_ to ensure a does not consume anything (but it is best +to avoid wrapping large parsers with try_).

val (<?>) : 'a t ‑> string ‑> 'a t

a <?> msg behaves like a, but if a fails without +consuming any input, it fails with msg +instead. Useful as the last choice in a series of <|>: +a <|> b <|> c <?> "expected a|b|c".

\ No newline at end of file diff --git a/2.3/containers/CCParse/U/index.html b/2.3/containers/CCParse/U/index.html new file mode 100644 index 00000000..317eebba --- /dev/null +++ b/2.3/containers/CCParse/U/index.html @@ -0,0 +1,6 @@ + +U (containers.CCParse.U)

Module CCParse.U

val list : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a t ‑> 'a list t

list p parses a list of p, with the OCaml conventions for +start token "", stop token "" and separator ";". +Whitespace between items are skipped.

val int : int t

Parse an int.

val word : string t

Non empty string of alpha num, start with alpha.

val pair : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a t ‑> 'b t ‑> ('a * 'b) t

Parse a pair using OCaml whitespace conventions. +The default is "(a, b)".

val triple : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t

Parse a triple using OCaml whitespace conventions. +The default is "(a, b, c)".

\ No newline at end of file diff --git a/2.3/containers/CCParse/index.html b/2.3/containers/CCParse/index.html new file mode 100644 index 00000000..e8f3a6d3 --- /dev/null +++ b/2.3/containers/CCParse/index.html @@ -0,0 +1,51 @@ + +CCParse (containers.CCParse)

Module CCParse

Very Simple Parser Combinators

      open CCParse;;
+
+      type tree = L of int | N of tree * tree;;
+
+      let mk_leaf x = L x
+      let mk_node x y = N(x,y)
+
+      let ptree = fix @@ fun self ->
+        skip_space *>
+          ( (try_ (char '(') *> (pure mk_node <*> self <*> self) <* char ')')
+            <|>
+              (U.int >|= mk_leaf) )
+      ;;
+
+      parse_string_exn ptree "(1 (2 3))" ;;
+      parse_string_exn ptree "((1 2) (3 (4 5)))" ;;
+
Parse a list of words
      open Containers.Parse;;
+      let p = U.list ~sep:"," U.word;;
+      parse_string_exn p "[abc , de, hello ,world  ]";;
Stress Test

+This makes a list of 100_000 integers, prints it and parses it back.

      let p = CCParse.(U.list ~sep:"," U.int);;
+
+      let l = CCList.(1 -- 100_000);;
+      let l_printed =
+        CCFormat.(to_string (within "[" "]" (list ~sep:(return ",@,") int))) l;;
+
+      let l' = CCParse.parse_string_exn p l_printed;;
+
+      assert (l=l');;
type 'a or_error = ('a, string) Result.result
type line_num = int
type col_num = int
type parse_branch
val string_of_branch : parse_branch ‑> string
exception ParseError of parse_branch * unit ‑> string

parsing branch * message.

Input

type position
type state
val state_of_string : string ‑> state

Combinators

type 'a t = state ‑> ok:('a ‑> unit) ‑> err:(exn ‑> unit) ‑> unit

Takes the input and two continuations: +

  • ok to call with the result when it's done
  • err to call when the parser met an error
  • Raises ParseError: in case of failure.
val return : 'a ‑> 'a t

Always succeeds, without consuming its input.

val pure : 'a ‑> 'a t

Synonym to return.

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Map.

val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t
val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t
val map3 : ('a ‑> 'b ‑> 'c ‑> 'd) ‑> 'a t ‑> 'b t ‑> 'c t ‑> 'd t
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind. +p >>= f results in a new parser which behaves as p then, +in case of success, applies f to the result.

val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

Applicative.

val (<*) : 'a t ‑> _ t ‑> 'a t

a <* b parses a into x, parses b and ignores its result, +and returns x.

val (*>) : _ t ‑> 'a t ‑> 'a t

a *> b parses a, then parses b into x, and returns x. The +results of a is ignored.

val fail : string ‑> 'a t

fail msg fails with the given message. It can trigger a backtrack.

val failf : ('a, unit, string, 'b t) Pervasives.format4 ‑> 'a

Format.sprintf version of fail.

val parsing : string ‑> 'a t ‑> 'a t

parsing s p behaves the same as p, with the information that +we are parsing s, if p fails.

val eoi : unit t

Expect the end of input, fails otherwise.

val nop : unit t

Succeed with ().

val char : char ‑> char t

char c parses the character c and nothing else.

val char_if : (char ‑> bool) ‑> char t

char_if f parses a character c if f c = true.

val chars_if : (char ‑> bool) ‑> string t

chars_if f parses a string of chars that satisfy f.

val chars1_if : (char ‑> bool) ‑> string t

Like chars_if, but only non-empty strings.

val endline : char t

Parse '\n'.

val space : char t

Tab or space.

val white : char t

Tab or space or newline.

val skip_chars : (char ‑> bool) ‑> unit t

Skip 0 or more chars satisfying the predicate.

val skip_space : unit t

Skip ' ' and '\t'.

val skip_white : unit t

Skip ' ' and '\t' and '\n'.

val is_alpha : char ‑> bool

Is the char a letter?

val is_num : char ‑> bool

Is the char a digit?

val is_alpha_num : char ‑> bool

Is the char a letter or a digit?

val is_space : char ‑> bool

True on ' ' and '\t'.

val is_white : char ‑> bool

True on ' ' and '\t' and '\n'.

val (<|>) : 'a t ‑> 'a t ‑> 'a t

a <|> b tries to parse a, and if a fails without +consuming any input, backtracks and tries +to parse b, otherwise it fails as a. +See try_ to ensure a does not consume anything (but it is best +to avoid wrapping large parsers with try_).

val (<?>) : 'a t ‑> string ‑> 'a t

a <?> msg behaves like a, but if a fails without +consuming any input, it fails with msg +instead. Useful as the last choice in a series of <|>: +a <|> b <|> c <?> "expected a|b|c".

val try_ : 'a t ‑> 'a t

try_ p tries to parse like p, but backtracks if p fails. +Useful in combination with <|>.

val suspend : (unit ‑> 'a t) ‑> 'a t

suspend f is the same as f (), but evaluates f () only +when needed.

val string : string ‑> string t

string s parses exactly the string s, and nothing else.

val many : 'a t ‑> 'a list t

many p parses a list of p, eagerly (as long as possible).

val many1 : 'a t ‑> 'a list t

Parse a non-empty list.

val skip : _ t ‑> unit t

skip p parses zero or more times p and ignores its result.

val sep : by:_ t ‑> 'a t ‑> 'a list t

sep ~by p parses a list of p separated by by.

val sep1 : by:_ t ‑> 'a t ‑> 'a list t

sep1 ~by p parses a non empty list of p, separated by by.

val fix : ('a t ‑> 'a t) ‑> 'a t

Fixpoint combinator.

val memo : 'a t ‑> 'a t

Memoize the parser. memo p will behave like p, but when called +in a state (read: position in input) it has already processed, memo p +returns a result directly. The implementation uses an underlying +hashtable. +This can be costly in memory, but improve the run time a lot if there +is a lot of backtracking involving p.

This function is not thread-safe.

val fix_memo : ('a t ‑> 'a t) ‑> 'a t

Like fix, but the fixpoint is memoized.

val get_lnum : int t

Reflect the current line number.

val get_cnum : int t

Reflect the current column number.

val get_pos : (int * int) t

Reflect the current (line, column) numbers.

Parse

Those functions have a label ~p on the parser, since 0.14.

val parse : 'a t ‑> state ‑> 'a or_error

parse p st applies p on the input, and returns Ok x if +p succeeds with x, or Error s otherwise.

val parse_exn : 'a t ‑> state ‑> 'a

Unsafe version of parse.

  • Raises ParseError: if it fails.
val parse_string : 'a t ‑> string ‑> 'a or_error

Specialization of parse for string inputs.

val parse_string_exn : 'a t ‑> string ‑> 'a
  • Raises ParseError: if it fails.
val parse_file : 'a t ‑> string ‑> 'a or_error

parse_file p file parses file with p by opening the file +and reading it whole.

val parse_file_exn : 'a t ‑> string ‑> 'a
  • Raises ParseError: if it fails.

Infix

module Infix : sig ... end

Utils

This is useful to parse OCaml-like values in a simple way.

module U : sig ... end
\ No newline at end of file diff --git a/2.3/containers/CCPersistentArray/.jbuilder-keep b/2.3/containers/CCPersistentArray/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCPersistentArray/index.html b/2.3/containers/CCPersistentArray/index.html new file mode 100644 index 00000000..2047d50a --- /dev/null +++ b/2.3/containers/CCPersistentArray/index.html @@ -0,0 +1,20 @@ + +CCPersistentArray (containers.CCPersistentArray)

Module CCPersistentArray

Persistent Arrays

From the paper by Jean-Christophe Filliâtre, +"A persistent Union-Find data structure", see +the ps version

type 'a t

The type of persistent arrays

val make : int ‑> 'a ‑> 'a t

make n x returns a persistent array of length n, with x. All the +elements of this new array are initially physically equal to x +(in the sense of the == predicate). Consequently, if x is mutable, it is +shared among all elements of the array, and modifying x through one of the +array entries will modify all other entries at the same time.

  • Raises Invalid_argument: if n < 0 or n > Sys.max_array_length. +If the value of x is a floating-point number, then the maximum size is +only Sys.max_array_length / 2.
val init : int ‑> (int ‑> 'a) ‑> 'a t

init n f returns a persistent array of length n, with element +i initialized to the result of f i.

  • Raises Invalid_argument: if n < 0 or n > Sys.max_array_length. +If the value of x is a floating-point number, then the maximum size is +only Sys.max_array_length / 2.
val get : 'a t ‑> int ‑> 'a

get a i returns the element with index i from the array a.

  • Raises Invalid_argument: "index out of bounds" if n is outside the +range 0 to Array.length a - 1.
val set : 'a t ‑> int ‑> 'a ‑> 'a t

set a i v sets the element index i from the array a to v.

  • Raises Invalid_argument: "index out of bounds" if n is outside the +range 0 to Array.length a - 1.
val length : 'a t ‑> int

Return the length of the persistent array.

val copy : 'a t ‑> 'a t

copy a returns a fresh copy of a. Both copies are independent.

val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t
val mapi : (int ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Apply the given function to all elements of the array, and return +a persistent array initialized by the results of f. In the case of mapi, +the function is also given the index of the element. +It is equivalent to fun f t -> init (fun i -> f (get t i)).

val iter : ('a ‑> unit) ‑> 'a t ‑> unit

iter f t applies function f to all elements of the persistent array, +in order from element 0 to element length t - 1.

val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

iter f t applies function f to all elements of the persistent array, +in order from element 0 to element length t - 1.

val fold_left : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a
val fold_right : ('a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b

Fold on the elements of the array.

val append : 'a t ‑> 'a t ‑> 'a t

Append the two arrays.

  • Since: 0.13
val flatten : 'a t t ‑> 'a t

Concatenates all the sub-arrays.

  • Since: 0.13
val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b t

Flat map (map + concatenation).

  • Since: 0.13
val to_array : 'a t ‑> 'a array

to_array t returns a mutable copy of t.

val of_array : 'a array ‑> 'a t

of_array a returns an immutable copy of a.

val to_list : 'a t ‑> 'a list

to_list t returns the list of elements in t.

val of_list : 'a list ‑> 'a t

of_list l returns a fresh persistent array containing the elements of l.

val of_rev_list : 'a list ‑> 'a t

of_rev_list l is the same as of_list (List.rev l) but more efficient.

  • Since: 0.13

Conversions

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
val to_seq : 'a t ‑> 'a sequence
val of_seq : 'a sequence ‑> 'a t
val of_gen : 'a gen ‑> 'a t
  • Since: 0.13
val to_gen : 'a t ‑> 'a gen
  • Since: 0.13

IO

type 'a printer = Format.formatter ‑> 'a ‑> unit
val pp : 'a printer ‑> 'a t printer
  • Since: 0.13
\ No newline at end of file diff --git a/2.3/containers/CCPersistentHashtbl/.jbuilder-keep b/2.3/containers/CCPersistentHashtbl/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCPersistentHashtbl/Make/argument-1-H/index.html b/2.3/containers/CCPersistentHashtbl/Make/argument-1-H/index.html new file mode 100644 index 00000000..e6b80cdb --- /dev/null +++ b/2.3/containers/CCPersistentHashtbl/Make/argument-1-H/index.html @@ -0,0 +1,2 @@ + +1-H (containers.CCPersistentHashtbl.Make.1-H)

Parameter CCPersistentHashtbl.Make.1-H

type t
val equal : t ‑> t ‑> bool
val hash : t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCPersistentHashtbl/Make/index.html b/2.3/containers/CCPersistentHashtbl/Make/index.html new file mode 100644 index 00000000..0a7ee395 --- /dev/null +++ b/2.3/containers/CCPersistentHashtbl/Make/index.html @@ -0,0 +1,10 @@ + +Make (containers.CCPersistentHashtbl.Make)

Module CCPersistentHashtbl.Make

Parameters

Signature

type key = H.t
type 'a t
val empty : unit ‑> 'a t

Empty table. The table will be allocated at the first binding.

val create : int ‑> 'a t

Create a new hashtable, with the given initial capacity.

val is_empty : 'a t ‑> bool

Is the table empty?

val find : 'a t ‑> key ‑> 'a

Find the value for this key, or fails.

  • Raises Not_found: if the key is not present in the table.
val get_exn : key ‑> 'a t ‑> 'a

Synonym to find with flipped arguments.

val get : key ‑> 'a t ‑> 'a option

Safe version of get_exn.

val mem : 'a t ‑> key ‑> bool

Is the key bound?

val length : _ t ‑> int

Number of bindings.

val add : 'a t ‑> key ‑> 'a ‑> 'a t

Add the binding to the table, returning a new table. The old binding +for this key, if it exists, is shadowed and will be restored upon +remove tbl k.

  • Since: 0.14
val replace : 'a t ‑> key ‑> 'a ‑> 'a t

Add the binding to the table, returning a new table. This erases +the current binding for key, if any.

val update : 'a t ‑> key ‑> ('a option ‑> 'a option) ‑> 'a t

update tbl key f calls f None if key doesn't belong in tbl, +f (Some v) if key -> v otherwise; If f returns None then +key is removed, else it returns Some v' and key -> v' is added.

val remove : 'a t ‑> key ‑> 'a t

Remove the key.

val copy : 'a t ‑> 'a t

Fresh copy of the table; the underlying structure is not shared +anymore, so using both tables alternatively will be efficient.

val merge : f:(key ‑> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

Merge two tables together into a new table. The function's argument +correspond to values associated with the key (if present); if the +function returns None the key will not appear in the result.

val iter : 'a t ‑> (key ‑> 'a ‑> unit) ‑> unit

Iterate over bindings.

val fold : ('b ‑> key ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

Fold over bindings.

val map : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Map all values.

val filter : (key ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t
val filter_map : (key ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b t
val for_all : (key ‑> 'a ‑> bool) ‑> 'a t ‑> bool
val exists : (key ‑> 'a ‑> bool) ‑> 'a t ‑> bool

Conversions

val of_seq : (key * 'a) sequence ‑> 'a t

Add (replace) bindings from the sequence to the table.

val of_list : (key * 'a) list ‑> 'a t
val add_seq : 'a t ‑> (key * 'a) sequence ‑> 'a t
val add_list : 'a t ‑> (key * 'a) list ‑> 'a t
val to_seq : 'a t ‑> (key * 'a) sequence

Sequence of the bindings of the table.

val to_list : 'a t ‑> (key * 'a) list

Misc

val equal : 'a equal ‑> 'a t equal
val pp : ?⁠sep:string ‑> ?⁠arrow:string ‑> key printer ‑> 'a printer ‑> 'a t printer
val stats : _ t ‑> Hashtbl.statistics

Statistics on the internal table.

  • Since: 0.14
\ No newline at end of file diff --git a/2.3/containers/CCPersistentHashtbl/index.html b/2.3/containers/CCPersistentHashtbl/index.html new file mode 100644 index 00000000..09f6cdaf --- /dev/null +++ b/2.3/containers/CCPersistentHashtbl/index.html @@ -0,0 +1,5 @@ + +CCPersistentHashtbl (containers.CCPersistentHashtbl)

Module CCPersistentHashtbl

Persistent hash-table on top of OCaml's hashtables

Almost as efficient as the regular Hashtbl type, but with a persistent +interface (rewinding changes to get back in the past history). This is +mostly useful for backtracking-like uses, or forward uses (never using +old values).

This module is not thread-safe.

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a equal = 'a ‑> 'a ‑> bool
module type HashedType : sig ... end

Signature of such a hashtable

module type S : sig ... end

Implementation

module Make : functor (H : HashedType) -> S with type key = H.t
\ No newline at end of file diff --git a/2.3/containers/CCPersistentHashtbl/module-type-HashedType/index.html b/2.3/containers/CCPersistentHashtbl/module-type-HashedType/index.html new file mode 100644 index 00000000..7126730a --- /dev/null +++ b/2.3/containers/CCPersistentHashtbl/module-type-HashedType/index.html @@ -0,0 +1,2 @@ + +HashedType (containers.CCPersistentHashtbl.HashedType)

Module type CCPersistentHashtbl.HashedType

type t
val equal : t ‑> t ‑> bool
val hash : t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCPersistentHashtbl/module-type-S/index.html b/2.3/containers/CCPersistentHashtbl/module-type-S/index.html new file mode 100644 index 00000000..1095ac6f --- /dev/null +++ b/2.3/containers/CCPersistentHashtbl/module-type-S/index.html @@ -0,0 +1,10 @@ + +S (containers.CCPersistentHashtbl.S)

Module type CCPersistentHashtbl.S

type key
type 'a t
val empty : unit ‑> 'a t

Empty table. The table will be allocated at the first binding.

val create : int ‑> 'a t

Create a new hashtable, with the given initial capacity.

val is_empty : 'a t ‑> bool

Is the table empty?

val find : 'a t ‑> key ‑> 'a

Find the value for this key, or fails.

  • Raises Not_found: if the key is not present in the table.
val get_exn : key ‑> 'a t ‑> 'a

Synonym to find with flipped arguments.

val get : key ‑> 'a t ‑> 'a option

Safe version of get_exn.

val mem : 'a t ‑> key ‑> bool

Is the key bound?

val length : _ t ‑> int

Number of bindings.

val add : 'a t ‑> key ‑> 'a ‑> 'a t

Add the binding to the table, returning a new table. The old binding +for this key, if it exists, is shadowed and will be restored upon +remove tbl k.

  • Since: 0.14
val replace : 'a t ‑> key ‑> 'a ‑> 'a t

Add the binding to the table, returning a new table. This erases +the current binding for key, if any.

val update : 'a t ‑> key ‑> ('a option ‑> 'a option) ‑> 'a t

update tbl key f calls f None if key doesn't belong in tbl, +f (Some v) if key -> v otherwise; If f returns None then +key is removed, else it returns Some v' and key -> v' is added.

val remove : 'a t ‑> key ‑> 'a t

Remove the key.

val copy : 'a t ‑> 'a t

Fresh copy of the table; the underlying structure is not shared +anymore, so using both tables alternatively will be efficient.

val merge : f:(key ‑> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

Merge two tables together into a new table. The function's argument +correspond to values associated with the key (if present); if the +function returns None the key will not appear in the result.

val iter : 'a t ‑> (key ‑> 'a ‑> unit) ‑> unit

Iterate over bindings.

val fold : ('b ‑> key ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

Fold over bindings.

val map : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Map all values.

val filter : (key ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t
val filter_map : (key ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b t
val for_all : (key ‑> 'a ‑> bool) ‑> 'a t ‑> bool
val exists : (key ‑> 'a ‑> bool) ‑> 'a t ‑> bool

Conversions

val of_seq : (key * 'a) sequence ‑> 'a t

Add (replace) bindings from the sequence to the table.

val of_list : (key * 'a) list ‑> 'a t
val add_seq : 'a t ‑> (key * 'a) sequence ‑> 'a t
val add_list : 'a t ‑> (key * 'a) list ‑> 'a t
val to_seq : 'a t ‑> (key * 'a) sequence

Sequence of the bindings of the table.

val to_list : 'a t ‑> (key * 'a) list

Misc

val equal : 'a equal ‑> 'a t equal
val pp : ?⁠sep:string ‑> ?⁠arrow:string ‑> key printer ‑> 'a printer ‑> 'a t printer
val stats : _ t ‑> Hashtbl.statistics

Statistics on the internal table.

  • Since: 0.14
\ No newline at end of file diff --git a/2.3/containers/CCPool/.jbuilder-keep b/2.3/containers/CCPool/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCPool/Make/Fut/Infix/index.html b/2.3/containers/CCPool/Make/Fut/Infix/index.html new file mode 100644 index 00000000..37a64716 --- /dev/null +++ b/2.3/containers/CCPool/Make/Fut/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCPool.Make.Fut.Infix)

Module CCPool.Make.Fut.Infix

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
val (>>) : 'a t ‑> (unit ‑> 'b t) ‑> 'b t
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t
\ No newline at end of file diff --git a/2.3/containers/CCPool/Make/Fut/index.html b/2.3/containers/CCPool/Make/Fut/index.html new file mode 100644 index 00000000..114eb6e2 --- /dev/null +++ b/2.3/containers/CCPool/Make/Fut/index.html @@ -0,0 +1,22 @@ + +Fut (containers.CCPool.Make.Fut)

Module CCPool.Make.Fut

Futures

The futures are registration points for callbacks, storing a state, +that are executed in the pool using run.

type 'a t

A future value of type 'a

type 'a future = 'a t

Constructors

val return : 'a ‑> 'a t

Future that is already computed.

val fail : exn ‑> 'a t

Future that fails immediately.

val make : (unit ‑> 'a) ‑> 'a t

Create a future, representing a value that will be computed by +the function. If the function raises, the future will fail.

val make1 : ('a ‑> 'b) ‑> 'a ‑> 'b t
val make2 : ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> 'c t

Basics

val get : 'a t ‑> 'a

Blocking get: wait for the future to be evaluated, and get the value, +or the exception that failed the future is returned. +Raise e if the future failed with e.

val state : 'a t ‑> 'a state

State of the future.

val is_done : 'a t ‑> bool

Is the future evaluated (success/failure)?

Combinators

val on_success : 'a t ‑> ('a ‑> unit) ‑> unit

Attach a handler to be called upon success. +The handler should not call functions on the future. +Might be evaluated now if the future is already done.

val on_failure : _ t ‑> (exn ‑> unit) ‑> unit

Attach a handler to be called upon failure. +The handler should not call any function on the future. +Might be evaluated now if the future is already done.

val on_finish : 'a t ‑> ('a state ‑> unit) ‑> unit

Attach a handler to be called when the future is evaluated. +The handler should not call functions on the future. +Might be evaluated now if the future is already done.

val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b t

Monadic combination of futures.

val and_then : 'a t ‑> (unit ‑> 'b t) ‑> 'b t

Wait for the first future to succeed, then launch the second.

val sequence_a : 'a t array ‑> 'a array t

Future that waits for all previous futures to terminate. If any future +in the array fails, sequence_a l fails too.

val map_a : ('a ‑> 'b t) ‑> 'a array ‑> 'b array t

map_a f a maps f on every element of a, and will return +the array of every result if all calls succeed, or an error otherwise.

val sequence_l : 'a t list ‑> 'a list t

Future that waits for all previous futures to terminate. If any future +in the list fails, sequence_l l fails too.

val map_l : ('a ‑> 'b t) ‑> 'a list ‑> 'b list t

map_l f l maps f on every element of l, and will return +the list of every result if all calls succeed, or an error otherwise.

val choose_a : 'a t array ‑> 'a t

Choose among those futures (the first to terminate). Behaves like +the first future that terminates, by failing if the future fails.

val choose_l : 'a t list ‑> 'a t

Choose among those futures (the first to terminate). Behaves like +the first future that terminates, by failing if the future fails.

val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Map the value inside the future. The function doesn't run in its +own task; if it can take time, use flat_map or map_async.

val map_async : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Map the value inside the future, to be computed in a separated job.

val app : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

app f x applies the result of f to the result of x.

val app_async : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

app_async f x applies the result of f to the result of x, in +a separated job scheduled in the pool.

val sleep : float ‑> unit t

Future that returns with success in the given amount of seconds. Blocks +the thread! If you need to wait on many events, consider +using CCTimer.

module Infix : sig ... end
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
val (>>) : 'a t ‑> (unit ‑> 'b t) ‑> 'b t
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Alias to map.

val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

Alias to app.

\ No newline at end of file diff --git a/2.3/containers/CCPool/Make/argument-1-P/index.html b/2.3/containers/CCPool/Make/argument-1-P/index.html new file mode 100644 index 00000000..730f239a --- /dev/null +++ b/2.3/containers/CCPool/Make/argument-1-P/index.html @@ -0,0 +1,2 @@ + +1-P (containers.CCPool.Make.1-P)

Parameter CCPool.Make.1-P

val max_size : int

Maximum number of threads in the pool.

\ No newline at end of file diff --git a/2.3/containers/CCPool/Make/index.html b/2.3/containers/CCPool/Make/index.html new file mode 100644 index 00000000..97f31b38 --- /dev/null +++ b/2.3/containers/CCPool/Make/index.html @@ -0,0 +1,3 @@ + +Make (containers.CCPool.Make)

Module CCPool.Make

Create a new Pool

Parameters

Signature

val run : (unit ‑> _) ‑> unit

run f schedules f for being executed in the thread pool.

val run1 : ('a ‑> _) ‑> 'a ‑> unit

run1 f x is similar to run (fun () -> f x).

val run2 : ('a ‑> 'b ‑> _) ‑> 'a ‑> 'b ‑> unit
val run3 : ('a ‑> 'b ‑> 'c ‑> _) ‑> 'a ‑> 'b ‑> 'c ‑> unit
val set_exn_handler : (exn ‑> unit) ‑> unit
val active : unit ‑> bool

active () is true as long as stop() has not been called yet.

val stop : unit ‑> unit

After calling stop (), most functions will raise Stopped. +This has the effect of preventing new tasks from being executed.

module Fut : sig ... end
Futures
\ No newline at end of file diff --git a/2.3/containers/CCPool/index.html b/2.3/containers/CCPool/index.html new file mode 100644 index 00000000..65650a6f --- /dev/null +++ b/2.3/containers/CCPool/index.html @@ -0,0 +1,2 @@ + +CCPool (containers.CCPool)

Module CCPool

Thread Pool, and Futures

Renamed and heavily updated from CCFuture.

type +'a state =
| Done of 'a
| Waiting
| Failed of exn
module type PARAM : sig ... end
exception Stopped
module Make : functor (P : PARAM) -> sig ... end

Create a new Pool

\ No newline at end of file diff --git a/2.3/containers/CCPool/module-type-PARAM/index.html b/2.3/containers/CCPool/module-type-PARAM/index.html new file mode 100644 index 00000000..a5ede94c --- /dev/null +++ b/2.3/containers/CCPool/module-type-PARAM/index.html @@ -0,0 +1,2 @@ + +PARAM (containers.CCPool.PARAM)

Module type CCPool.PARAM

val max_size : int

Maximum number of threads in the pool.

\ No newline at end of file diff --git a/2.3/containers/CCRAL/.jbuilder-keep b/2.3/containers/CCRAL/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCRAL/Infix/index.html b/2.3/containers/CCRAL/Infix/index.html new file mode 100644 index 00000000..6aefcd09 --- /dev/null +++ b/2.3/containers/CCRAL/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCRAL.Infix)

Module CCRAL.Infix

val (@+) : 'a ‑> 'a t ‑> 'a t

Cons (alias to cons).

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Alias to flat_map.

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Alias to map.

val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

Alias to app.

val (--) : int ‑> int ‑> int t

Alias to range.

val (--^) : int ‑> int ‑> int t

a --^ b is the integer range from a to b, where b is excluded.

  • Since: 0.17
\ No newline at end of file diff --git a/2.3/containers/CCRAL/index.html b/2.3/containers/CCRAL/index.html new file mode 100644 index 00000000..ffd61766 --- /dev/null +++ b/2.3/containers/CCRAL/index.html @@ -0,0 +1,6 @@ + +CCRAL (containers.CCRAL)

Module CCRAL

Random-Access Lists

This is an OCaml implementation of Okasaki's paper +"Purely Functional Random Access Lists". It defines a list-like data +structure with O(1) cons/tail operations, and O(log(n)) lookup/modification +operations.

This module used to be part of containers.misc

status: stable

type +'a t

List containing elements of type 'a

val empty : 'a t

Empty list.

val is_empty : _ t ‑> bool

Check whether the list is empty.

val cons : 'a ‑> 'a t ‑> 'a t

Add an element at the front of the list.

val return : 'a ‑> 'a t

Singleton.

val map : f:('a ‑> 'b) ‑> 'a t ‑> 'b t

Map on elements.

val mapi : f:(int ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Map with index.

val hd : 'a t ‑> 'a

First element of the list, or

  • Raises Invalid_argument: if the list is empty.
val tl : 'a t ‑> 'a t

Remove the first element from the list, or

  • Raises Invalid_argument: if the list is empty.
val front : 'a t ‑> ('a * 'a t) option

Remove and return the first element of the list.

val front_exn : 'a t ‑> 'a * 'a t

Unsafe version of front.

  • Raises Invalid_argument: if the list is empty.
val length : 'a t ‑> int

Number of elements. Complexity O(ln n) where n=number of elements.

val get : 'a t ‑> int ‑> 'a option

get l i accesses the i-th element of the list. O(log(n)).

val get_exn : 'a t ‑> int ‑> 'a

Unsafe version of get.

  • Raises Invalid_argument: if the list has less than i+1 elements.
val set : 'a t ‑> int ‑> 'a ‑> 'a t

set l i v sets the i-th element of the list to v. O(log(n)).

  • Raises Invalid_argument: if the list has less than i+1 elements.
val remove : 'a t ‑> int ‑> 'a t

remove l i removes the i-th element of v.

  • Raises Invalid_argument: if the list has less than i+1 elements.
val append : 'a t ‑> 'a t ‑> 'a t
val filter : f:('a ‑> bool) ‑> 'a t ‑> 'a t
val filter_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b t
val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b t
val flatten : 'a t t ‑> 'a t
val app : ('a ‑> 'b) t ‑> 'a t ‑> 'b t
val take : int ‑> 'a t ‑> 'a t
val take_while : f:('a ‑> bool) ‑> 'a t ‑> 'a t
val drop : int ‑> 'a t ‑> 'a t
val drop_while : f:('a ‑> bool) ‑> 'a t ‑> 'a t
val take_drop : int ‑> 'a t ‑> 'a t * 'a t

take_drop n l splits l into a, b such that length a = n +if length l >= n, and such that append a b = l.

val iter : f:('a ‑> unit) ‑> 'a t ‑> unit

Iterate on the list's elements.

val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val fold : f:('b ‑> 'a ‑> 'b) ‑> x:'b ‑> 'a t ‑> 'b

Fold on the list's elements.

val fold_rev : f:('b ‑> 'a ‑> 'b) ‑> x:'b ‑> 'a t ‑> 'b

Fold on the list's elements, in reverse order (starting from the tail).

val rev_map : f:('a ‑> 'b) ‑> 'a t ‑> 'b t

rev_map f l is the same as map f (rev l).

val rev : 'a t ‑> 'a t

Reverse the list.

val equal : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool
val compare : cmp:('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a t ‑> int

Lexicographic comparison.

Utils

val make : int ‑> 'a ‑> 'a t
val repeat : int ‑> 'a t ‑> 'a t

repeat n l is append l (append l ... l)n times.

val range : int ‑> int ‑> int t

range i j is i; i+1; ... ; j or j; j-1; ...; i.

Conversions

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
val add_list : 'a t ‑> 'a list ‑> 'a t
val of_list : 'a list ‑> 'a t

Convert a list to a RAL. Caution: non tail-rec.

val to_list : 'a t ‑> 'a list
val of_list_map : f:('a ‑> 'b) ‑> 'a list ‑> 'b t

Combination of of_list and map.

val of_array : 'a array ‑> 'a t
val add_array : 'a t ‑> 'a array ‑> 'a t
val to_array : 'a t ‑> 'a array

More efficient than on usual lists.

val add_seq : 'a t ‑> 'a sequence ‑> 'a t
val of_seq : 'a sequence ‑> 'a t
val to_seq : 'a t ‑> 'a sequence
val add_gen : 'a t ‑> 'a gen ‑> 'a t
val of_gen : 'a gen ‑> 'a t
val to_gen : 'a t ‑> 'a gen

Infix

module Infix : sig ... end
include module type of Infix
val (@+) : 'a ‑> 'a t ‑> 'a t

Cons (alias to cons).

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Alias to flat_map.

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Alias to map.

val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

Alias to app.

val (--) : int ‑> int ‑> int t

Alias to range.

val (--^) : int ‑> int ‑> int t

a --^ b is the integer range from a to b, where b is excluded.

  • Since: 0.17

IO

type 'a printer = Format.formatter ‑> 'a ‑> unit
val pp : ?⁠sep:string ‑> 'a printer ‑> 'a t printer
\ No newline at end of file diff --git a/2.3/containers/CCRandom/.jbuilder-keep b/2.3/containers/CCRandom/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCRandom/index.html b/2.3/containers/CCRandom/index.html new file mode 100644 index 00000000..d6a34322 --- /dev/null +++ b/2.3/containers/CCRandom/index.html @@ -0,0 +1,23 @@ + +CCRandom (containers.CCRandom)

Module CCRandom

Random Generators

include module type of sig ... end
val init : int ‑> unit
val full_init : int array ‑> unit
val self_init : unit ‑> unit
val bits : unit ‑> int
val int : int ‑> int
val int32 : Int32.t ‑> Int32.t
val nativeint : Nativeint.t ‑> Nativeint.t
val int64 : Int64.t ‑> Int64.t
val float : float ‑> float
val bool : unit ‑> bool
module State = Random.State
val get_state : unit ‑> State.t
val set_state : State.t ‑> unit
type state = Random.State.t
type 'a t = state ‑> 'a

Random generator for values of type 'a.

type 'a random_gen = 'a t
val return : 'a ‑> 'a t

return x is the generator that always returns x. +Example: let random_int = return 4 (* fair dice roll *).

val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b t

flat_map f g st is f (g st) st.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind.

val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

map f g st is f (g st).

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
val delay : (unit ‑> 'a t) ‑> 'a t

Delay evaluation. Useful for side-effectful generators that +need some code to run for every call. +Example: +

      let gensym = let r = ref 0 in fun () -> incr r; !r ;;
+
+      delay (fun () ->
+        let name = gensym() in
+        small_int >>= fun i -> return (name,i)
+      )
  • Since: 0.4
val choose : 'a t list ‑> 'a option t

Choose a generator within the list.

val choose_exn : 'a t list ‑> 'a t

Like choose but without option.

  • Raises Invalid_argument: if the list is empty.
val choose_array : 'a t array ‑> 'a option t

Choose a generator within the array.

val choose_return : 'a list ‑> 'a t

Choose among the list.

  • Raises Invalid_argument: if the list is empty.
val replicate : int ‑> 'a t ‑> 'a list t

replicate n g makes a list of n elements which are all generated +randomly using g.

val sample_without_replacement : compare:('a ‑> 'a ‑> int) ‑> int ‑> 'a t ‑> 'a list t

sample_without_replacement n g makes a list of n elements which are all +generated randomly using g with the added constraint that none of the generated +random values are equal.

  • Raises Invalid_argument: if n <= 0.
  • Since: 0.15
val list_seq : 'a t list ‑> 'a list t

Build random lists from lists of random generators.

  • Since: 0.4
exception Pick_from_empty
  • Since: 0.16
val pick_list : 'a list ‑> 'a t

Pick an element at random from the list.

  • Raises Pick_from_empty: if the list is empty.
  • Since: 0.16
val pick_array : 'a array ‑> 'a t

Pick an element at random from the array.

  • Raises Pick_from_empty: if the array is empty.
  • Since: 0.16
val small_int : int t

A small int (100).

val int : int ‑> int t

Random int within the given range.

val int_range : int ‑> int ‑> int t

Inclusive range.

val small_float : float t

A reasonably small float (100.0).

  • Since: 0.6.1
val float : float ‑> float t

Random float within the given range.

  • Since: 0.6.1
val float_range : float ‑> float ‑> float t

Inclusive range. float_range a b assumes a < b.

  • Since: 0.6.1
val split : int ‑> (int * int) option t

Split a positive value n into n1,n2 where n = n1 + n2.

  • Returns None if the value is too small.
val split_list : int ‑> len:int ‑> int list option t

Split a value n into a list of values whose sum is n +and whose length is length. The list is never empty and does not +contain 0.

  • Raises Invalid_argument: if len <= 1.
  • Returns None if the value is too small.
val retry : ?⁠max:int ‑> 'a option t ‑> 'a option t

retry g calls g until it returns some value, or until the maximum +number of retries was reached. If g fails, +then it counts for one iteration, and the generator retries.

  • Parameter max: : maximum number of retries. Default 10.
val try_successively : 'a option t list ‑> 'a option t

try_successively l tries each generator of l, one after the other. +If some generator succeeds its result is returned, else the +next generator is tried.

val (<?>) : 'a option t ‑> 'a option t ‑> 'a option t

a <?> b is a choice operator. It first tries a, and returns its +result if successful. If a fails, then b is returned.

val fix : ?⁠sub1:('a t ‑> 'a t) list ‑> ?⁠sub2:('a t ‑> 'a t ‑> 'a t) list ‑> ?⁠subn:(int t * ('a list t ‑> 'a t)) list ‑> base:'a t ‑> int t ‑> 'a t

Recursion combinators, for building recursive values. +The integer generator is used to provide fuel. The sub_ generators +should use their arguments only once!

  • Parameter sub1: cases that recurse on one value.
  • Parameter sub2: cases that use the recursive gen twice.
  • Parameter subn: cases that use a list of recursive cases.
Applicative
val pure : 'a ‑> 'a t
val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t
Run a generator
val run : ?⁠st:state ‑> 'a t ‑> 'a

Using a random state (possibly the one in argument) run a generator.

\ No newline at end of file diff --git a/2.3/containers/CCRef/.jbuilder-keep b/2.3/containers/CCRef/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCRef/index.html b/2.3/containers/CCRef/index.html new file mode 100644 index 00000000..48464c9a --- /dev/null +++ b/2.3/containers/CCRef/index.html @@ -0,0 +1,2 @@ + +CCRef (containers.CCRef)

Module CCRef

References

type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a ord = 'a ‑> 'a ‑> int
type 'a eq = 'a ‑> 'a ‑> bool
type 'a sequence = ('a ‑> unit) ‑> unit
type 'a t = 'a Pervasives.ref
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Transform the value.

val create : 'a ‑> 'a t

Alias to ref.

val iter : ('a ‑> unit) ‑> 'a t ‑> unit

Call the function on the content of the reference.

val update : ('a ‑> 'a) ‑> 'a t ‑> unit

Update the reference's content with the given function.

val incr_then_get : int t ‑> int

incr_then_get r increments r and returns its new value, think ++r.

  • Since: 0.17
val get_then_incr : int t ‑> int

get_then_incr r increments r and returns its old value, think r++.

  • Since: 0.17
val swap : 'a t ‑> 'a t ‑> unit

swap t1 t2 puts !t2 in t1 and !t1 in t2.

  • Since: 1.4
val compare : 'a ord ‑> 'a t ord
val equal : 'a eq ‑> 'a t eq
val to_list : 'a t ‑> 'a list
val to_seq : 'a t ‑> 'a sequence
val pp : 'a printer ‑> 'a t printer
\ No newline at end of file diff --git a/2.3/containers/CCResult/.jbuilder-keep b/2.3/containers/CCResult/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCResult/Infix/index.html b/2.3/containers/CCResult/Infix/index.html new file mode 100644 index 00000000..a6636cf7 --- /dev/null +++ b/2.3/containers/CCResult/Infix/index.html @@ -0,0 +1,5 @@ + +Infix (containers.CCResult.Infix)

Module CCResult.Infix

val (>|=) : ('a'errt ‑> ('a ‑> 'b) ‑> ('b'errt
val (>>=) : ('a'errt ‑> ('a ‑> ('b'errt) ‑> ('b'errt

Monadic composition. e >>= f proceeds as f x if e is Ok x +or returns e if e is an Error.

val (<*>) : ('a ‑> 'b'errt ‑> ('a'errt ‑> ('b'errt

a <*> b evaluates a and b, and, in case of success, returns +Ok (a b). Otherwise, it fails, and the error of a is chosen +over the error of b if both fail.

\ No newline at end of file diff --git a/2.3/containers/CCResult/Traverse/argument-1-M/index.html b/2.3/containers/CCResult/Traverse/argument-1-M/index.html new file mode 100644 index 00000000..63ae4079 --- /dev/null +++ b/2.3/containers/CCResult/Traverse/argument-1-M/index.html @@ -0,0 +1,2 @@ + +1-M (containers.CCResult.Traverse.1-M)

Parameter CCResult.Traverse.1-M

type 'a t
val return : 'a ‑> 'a t

Monadic return.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind.

\ No newline at end of file diff --git a/2.3/containers/CCResult/Traverse/index.html b/2.3/containers/CCResult/Traverse/index.html new file mode 100644 index 00000000..70819ccb --- /dev/null +++ b/2.3/containers/CCResult/Traverse/index.html @@ -0,0 +1,2 @@ + +Traverse (containers.CCResult.Traverse)

Module CCResult.Traverse

Parameters

Signature

val sequence_m : ('a M.t'errt ‑> ('a'errt M.t
val fold_m : ('b ‑> 'a ‑> 'b M.t) ‑> 'b ‑> ('a'errt ‑> 'b M.t
val map_m : ('a ‑> 'b M.t) ‑> ('a'errt ‑> ('b'errt M.t
val retry_m : int ‑> (unit ‑> ('a'errt M.t) ‑> ('a'err list) t M.t
\ No newline at end of file diff --git a/2.3/containers/CCResult/index.html b/2.3/containers/CCResult/index.html new file mode 100644 index 00000000..07aebea5 --- /dev/null +++ b/2.3/containers/CCResult/index.html @@ -0,0 +1,28 @@ + +CCResult (containers.CCResult)

Module CCResult

Error Monad

Uses the new "result" type from OCaml 4.03.

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a equal = 'a ‑> 'a ‑> bool
type 'a ord = 'a ‑> 'a ‑> int
type 'a printer = Format.formatter ‑> 'a ‑> unit

Basics

  • Since: 1.5
include module type of sig ... end
type ('a, 'b) result = ('a'b) Pervasives.result =
| Ok of 'a
| Error of 'b
type (+'good, +'bad) t = ('good'bad) Result.result =
| Ok of 'good
| Error of 'bad
val return : 'a ‑> ('a'errt

Successfully return a value.

val fail : 'err ‑> ('a'errt

Fail with an error.

val of_exn : exn ‑> ('a, string) t

of_exn e uses Printexc to print the exception as a string.

val of_exn_trace : exn ‑> ('a, string) t

of_exn_trace e is similar to of_exn e, but it adds the stacktrace +to the error message.

Remember to call Printexc.record_backtrace true and compile with the +debug flag for this to work.

val fail_printf : ('a, Buffer.t, unit, ('b, string) t) Pervasives.format4 ‑> 'a

fail_printf format uses format to obtain an error message +and then returns Error msg.

val fail_fprintf : ('a, Format.formatter, unit, ('b, string) t) Pervasives.format4 ‑> 'a

fail_fprintf format uses format to obtain an error message +and then returns Error msg.

val add_ctx : string ‑> ('a, string) t ‑> ('a, string) t

add_ctx msg leaves Ok x untouched, but transforms +Error s into Error s' where s' contains the additional +context given by msg.

  • Since: 1.2
val add_ctxf : ('a, Format.formatter, unit, ('b, string) t ‑> ('b, string) t) Pervasives.format4 ‑> 'a

add_ctxf format_message is similar to add_ctx but with +Format for printing the message (eagerly). +Example: +

      add_ctxf "message(number %d, foo: %B)" 42 true (Error "error)"
  • Since: 1.2
val map : ('a ‑> 'b) ‑> ('a'errt ‑> ('b'errt

Map on success.

val map_err : ('err1 ‑> 'err2) ‑> ('a'err1t ‑> ('a'err2t

Map on the error variant.

val map2 : ('a ‑> 'b) ‑> ('err1 ‑> 'err2) ‑> ('a'err1t ‑> ('b'err2t

Like map, but also with a function that can transform +the error message in case of failure.

val iter : ('a ‑> unit) ‑> ('a_t ‑> unit

Apply the function only in case of Ok.

exception Get_error
val get_exn : ('a_t ‑> 'a

Extract the value x from Ok x, fails otherwise. +You should be careful with this function, and favor other combinators +whenever possible.

  • Raises Get_error: if the value is an error.
val get_or : ('a_t ‑> default:'a ‑> 'a

get_or e ~default returns x if e = Ok x, default otherwise.

val map_or : ('a ‑> 'b) ‑> ('a'ct ‑> default:'b ‑> 'b

map_or f e ~default returns f x if e = Ok x, default otherwise.

val catch : ('a'errt ‑> ok:('a ‑> 'b) ‑> err:('err ‑> 'b) ‑> 'b

catch e ~ok ~err calls either ok or err depending on +the value of e.

val flat_map : ('a ‑> ('b'errt) ‑> ('a'errt ‑> ('b'errt
val (>|=) : ('a'errt ‑> ('a ‑> 'b) ‑> ('b'errt
val (>>=) : ('a'errt ‑> ('a ‑> ('b'errt) ‑> ('b'errt

Monadic composition. e >>= f proceeds as f x if e is Ok x +or returns e if e is an Error.

val equal : err:'err equal ‑> 'a equal ‑> ('a'errt equal
val compare : err:'err ord ‑> 'a ord ‑> ('a'errt ord
val fold : ok:('a ‑> 'b) ‑> error:('err ‑> 'b) ‑> ('a'errt ‑> 'b

fold ~ok ~error e opens e and, if e = Ok x, returns +ok x, otherwise e = Error s and it returns error s.

val fold_ok : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> ('b_t ‑> 'a

fold_ok f acc r will compute f acc x if r=Ok x, +and return acc otherwise, as if the result were a mere option.

  • Since: 1.2
val is_ok : ('a'errt ‑> bool

Return true if Ok.

  • Since: 1.0
val is_error : ('a'errt ‑> bool

Return true if Error.

  • Since: 1.0

Wrappers

val guard : (unit ‑> 'a) ‑> ('a, exn) t

guard f runs f () and returns its result wrapped in Ok. If +f () raises some exception e, then it fails with Error e.

val guard_str : (unit ‑> 'a) ‑> ('a, string) t

Like guard but uses of_exn to print the exception.

val guard_str_trace : (unit ‑> 'a) ‑> ('a, string) t

Like guard_str but uses of_exn_trace instead of of_exn so +that the stack trace is printed.

val wrap1 : ('a ‑> 'b) ‑> 'a ‑> ('b, exn) t

Like guard but gives the function one argument.

val wrap2 : ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> ('c, exn) t

Like guard but gives the function two arguments.

val wrap3 : ('a ‑> 'b ‑> 'c ‑> 'd) ‑> 'a ‑> 'b ‑> 'c ‑> ('d, exn) t

Like guard but gives the function three arguments.

Applicative

val pure : 'a ‑> ('a'errt

Synonym of return.

val (<*>) : ('a ‑> 'b'errt ‑> ('a'errt ‑> ('b'errt

a <*> b evaluates a and b, and, in case of success, returns +Ok (a b). Otherwise, it fails, and the error of a is chosen +over the error of b if both fail.

val join : (('a'errt'errt ‑> ('a'errt

join t, in case of success, returns Ok o from Ok (Ok o). Otherwise, +it fails with Error e where e is the unwrapped error of t.

val both : ('a'errt ‑> ('b'errt ‑> ('a * 'b'errt

both a b, in case of success, returns Ok (o, o') with the ok values +of a and b. Otherwise, it fails, and the error of a is chosen over the +error of b if both fail.

Infix

module Infix : sig ... end

Collections

val map_l : ('a ‑> ('b'errt) ‑> 'a list ‑> ('b list, 'errt
val fold_l : ('b ‑> 'a ‑> ('b'errt) ‑> 'b ‑> 'a list ‑> ('b'errt
val fold_seq : ('b ‑> 'a ‑> ('b'errt) ‑> 'b ‑> 'a sequence ‑> ('b'errt

Misc

val choose : ('a'errt list ‑> ('a'err list) t

choose l selects a member of l that is a Ok _ value, +or returns Error l otherwise, where l is the list of errors.

val retry : int ‑> (unit ‑> ('a'errt) ‑> ('a'err list) t

retry n f calls f at most n times, returning the first result +of f () that doesn't fail. If f fails n times, retry n f fails +with the list of successive errors.

module type MONAD : sig ... end

Monadic Operations

module Traverse : functor (M : MONAD) -> sig ... end

Conversions

val to_opt : ('a_t ‑> 'a option

Convert a result to an option.

val of_opt : 'a option ‑> ('a, string) t

Convert an option to a result.

val to_seq : ('a_t ‑> 'a sequence
type ('a, 'b) error = [
| `Ok of 'a
| `Error of 'b
]
val of_err : ('a'berror ‑> ('a'bt
  • Since: 0.17
val to_err : ('a'bt ‑> ('a'berror
  • Since: 0.17

IO

val pp : 'a printer ‑> ('a, string) t printer
val pp' : 'a printer ‑> 'e printer ‑> ('a'et printer

Printer that is generic on the error type.

\ No newline at end of file diff --git a/2.3/containers/CCResult/module-type-MONAD/index.html b/2.3/containers/CCResult/module-type-MONAD/index.html new file mode 100644 index 00000000..95d076f3 --- /dev/null +++ b/2.3/containers/CCResult/module-type-MONAD/index.html @@ -0,0 +1,2 @@ + +MONAD (containers.CCResult.MONAD)

Module type CCResult.MONAD

Monadic Operations

type 'a t
val return : 'a ‑> 'a t

Monadic return.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind.

\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/.jbuilder-keep b/2.3/containers/CCRingBuffer/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCRingBuffer/Array/Byte/index.html b/2.3/containers/CCRingBuffer/Array/Byte/index.html new file mode 100644 index 00000000..12824a27 --- /dev/null +++ b/2.3/containers/CCRingBuffer/Array/Byte/index.html @@ -0,0 +1,5 @@ + +Byte (containers.CCRingBuffer.Array.Byte)

Module CCRingBuffer.Array.Byte

Efficient array version for the char type

type elt = char

The element type

type t = Bytes.t

The type of an array instance

val create : int ‑> t

Make an array of the given size, filled with dummy elements.

val length : t ‑> int

length t gets the total number of elements currently in t.

val get : t ‑> int ‑> elt

get t i gets the element at position i.

val set : t ‑> int ‑> elt ‑> unit

set t i e sets the element at position i to e.

val sub : t ‑> int ‑> int ‑> t

sub t i len gets the sub-array of t from +position i to i + len.

val copy : t ‑> t

copy t makes a fresh copy of the array t.

val blit : t ‑> int ‑> t ‑> int ‑> int ‑> unit

blit t s arr i len copies len elements from arr starting at i +to position s from t.

val iter : (elt ‑> unit) ‑> t ‑> unit

iter f t iterates over the array t invoking f with +the current element, in array order.

\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/Array/Make/argument-1-Elt/index.html b/2.3/containers/CCRingBuffer/Array/Make/argument-1-Elt/index.html new file mode 100644 index 00000000..76575963 --- /dev/null +++ b/2.3/containers/CCRingBuffer/Array/Make/argument-1-Elt/index.html @@ -0,0 +1,2 @@ + +1-Elt (containers.CCRingBuffer.Array.Make.1-Elt)

Parameter CCRingBuffer.Array.Make.1-Elt

type t
val dummy : t
\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/Array/Make/index.html b/2.3/containers/CCRingBuffer/Array/Make/index.html new file mode 100644 index 00000000..e4d6b8f9 --- /dev/null +++ b/2.3/containers/CCRingBuffer/Array/Make/index.html @@ -0,0 +1,5 @@ + +Make (containers.CCRingBuffer.Array.Make)

Module CCRingBuffer.Array.Make

Makes an array given an arbitrary element type

Parameters

Elt : sig ... end

Signature

type elt = Elt.t

The element type

type t = Elt.t array

The type of an array instance

val create : int ‑> t

Make an array of the given size, filled with dummy elements.

val length : t ‑> int

length t gets the total number of elements currently in t.

val get : t ‑> int ‑> elt

get t i gets the element at position i.

val set : t ‑> int ‑> elt ‑> unit

set t i e sets the element at position i to e.

val sub : t ‑> int ‑> int ‑> t

sub t i len gets the sub-array of t from +position i to i + len.

val copy : t ‑> t

copy t makes a fresh copy of the array t.

val blit : t ‑> int ‑> t ‑> int ‑> int ‑> unit

blit t s arr i len copies len elements from arr starting at i +to position s from t.

val iter : (elt ‑> unit) ‑> t ‑> unit

iter f t iterates over the array t invoking f with +the current element, in array order.

\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/Array/index.html b/2.3/containers/CCRingBuffer/Array/index.html new file mode 100644 index 00000000..37dc64c1 --- /dev/null +++ b/2.3/containers/CCRingBuffer/Array/index.html @@ -0,0 +1,2 @@ + +Array (containers.CCRingBuffer.Array)

Module CCRingBuffer.Array

The abstract type for arrays

module type S : sig ... end
module Byte : S with type elt = char and type t = Bytes.t

Efficient array version for the char type

module Make : functor (Elt : sig ... end) -> S with type elt = Elt.t and type t = Elt.t array

Makes an array given an arbitrary element type

\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/Array/module-type-S/index.html b/2.3/containers/CCRingBuffer/Array/module-type-S/index.html new file mode 100644 index 00000000..299ce80d --- /dev/null +++ b/2.3/containers/CCRingBuffer/Array/module-type-S/index.html @@ -0,0 +1,5 @@ + +S (containers.CCRingBuffer.Array.S)

Module type CCRingBuffer.Array.S

type elt

The element type

type t

The type of an array instance

val create : int ‑> t

Make an array of the given size, filled with dummy elements.

val length : t ‑> int

length t gets the total number of elements currently in t.

val get : t ‑> int ‑> elt

get t i gets the element at position i.

val set : t ‑> int ‑> elt ‑> unit

set t i e sets the element at position i to e.

val sub : t ‑> int ‑> int ‑> t

sub t i len gets the sub-array of t from +position i to i + len.

val copy : t ‑> t

copy t makes a fresh copy of the array t.

val blit : t ‑> int ‑> t ‑> int ‑> int ‑> unit

blit t s arr i len copies len elements from arr starting at i +to position s from t.

val iter : (elt ‑> unit) ‑> t ‑> unit

iter f t iterates over the array t invoking f with +the current element, in array order.

\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/Byte/index.html b/2.3/containers/CCRingBuffer/Byte/index.html new file mode 100644 index 00000000..65358dea --- /dev/null +++ b/2.3/containers/CCRingBuffer/Byte/index.html @@ -0,0 +1,15 @@ + +Byte (containers.CCRingBuffer.Byte)

Module CCRingBuffer.Byte

An efficient byte based ring buffer

module Array = Array.Byte

The module type of Array for this ring buffer

type t

Defines the bounded ring buffer type

exception Empty

Raised in querying functions when the buffer is empty

val create : int ‑> t

create size creates a new bounded buffer with given size. +The underlying array is allocated immediately and no further (large) +allocation will happen from now on.

  • Raises Invalid_argument: if the argument is < 1.
val copy : t ‑> t

Make a fresh copy of the buffer.

val capacity : t ‑> int

Length of the inner buffer.

val length : t ‑> int

Number of elements currently stored in the buffer.

val is_full : t ‑> bool

true if pushing an element would erase another element.

  • Since: 1.3
val blit_from : t ‑> Array.t ‑> int ‑> int ‑> unit

blit_from buf from_buf o len copies the slice o, ... o + len - 1 from +an input buffer from_buf to the end of the buffer. +If the slice is too large for the buffer, only the last part of the array +will be copied.

  • Raises Invalid_argument: if o,len is not a valid slice of s.
val blit_into : t ‑> Array.t ‑> int ‑> int ‑> int

blit_into buf to_buf o len copies at most len elements from buf +into to_buf starting at offset o in s.

  • Returns the number of elements actually copied (min len (length buf)).
  • Raises Invalid_argument: if o,len is not a valid slice of s.
val append : t ‑> into:t ‑> unit

append b ~into copies all data from b and adds it at the +end of into. Erases data of into if there is not enough room.

val to_list : t ‑> Array.elt list

Extract the current content into a list.

val clear : t ‑> unit

Clear the content of the buffer. Doesn't actually destroy the content.

val is_empty : t ‑> bool

Is the buffer empty (i.e. contains no elements)?

val junk_front : t ‑> unit

Drop the front element from t.

  • Raises Empty: if the buffer is already empty.
val junk_back : t ‑> unit

Drop the back element from t.

  • Raises Empty: if the buffer is already empty.
val skip : t ‑> int ‑> unit

skip b len removes len elements from the front of b.

  • Raises Invalid_argument: if len > length b.
val iter : t ‑> f:(Array.elt ‑> unit) ‑> unit

iter b ~f calls f i t for each element t in buf.

val iteri : t ‑> f:(int ‑> Array.elt ‑> unit) ‑> unit

iteri b ~f calls f i t for each element t in buf, with i +being its relative index within buf.

val get_front : t ‑> int ‑> Array.elt

get_front buf i returns the i-th element of buf from the front, i.e. +the one returned by take_front buf after i-1 calls to junk_front buf.

  • Raises Invalid_argument: if the index is invalid (> length buf).
val get_back : t ‑> int ‑> Array.elt

get_back buf i returns the i-th element of buf from the back, i.e. +the one returned by take_back buf after i-1 calls to junk_back buf.

  • Raises Invalid_argument: if the index is invalid (> length buf).
val push_back : t ‑> Array.elt ‑> unit

Push value at the back of t. +If t.bounded=false, the buffer will grow as needed, +otherwise the oldest elements are replaced first.

val peek_front : t ‑> Array.elt option

First value from front of t, without modification.

val peek_front_exn : t ‑> Array.elt

First value from front of t, without modification.

  • Raises Empty: if buffer is empty.
  • Since: 1.3
val peek_back : t ‑> Array.elt option

Get the last value from back of t, without modification.

val peek_back_exn : t ‑> Array.elt

Get the last value from back of t, without modification.

  • Raises Empty: if buffer is empty.
  • Since: 1.3
val take_back : t ‑> Array.elt option

Take and remove the last value from back of t, if any.

val take_back_exn : t ‑> Array.elt

Take and remove the last value from back of t.

  • Raises Empty: if buffer is already empty.
val take_front : t ‑> Array.elt option

Take and remove the first value from front of t, if any.

val take_front_exn : t ‑> Array.elt

Take and remove the first value from front of t.

  • Raises Empty: if buffer is already empty.
val of_array : Array.t ‑> t

Create a buffer from an initial array, but doesn't take ownership +of it (still allocates a new internal array).

  • Since: 0.11
val to_array : t ‑> Array.t

Create an array from the elements, in order.

  • Since: 0.11
\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/Make/Array/index.html b/2.3/containers/CCRingBuffer/Make/Array/index.html new file mode 100644 index 00000000..89dc6ef7 --- /dev/null +++ b/2.3/containers/CCRingBuffer/Make/Array/index.html @@ -0,0 +1,5 @@ + +Array (containers.CCRingBuffer.Make.Array)

Module CCRingBuffer.Make.Array

The module type of Array for this ring buffer

type elt = X.t

The element type

type t = X.t array

The type of an array instance

val create : int ‑> t

Make an array of the given size, filled with dummy elements.

val length : t ‑> int

length t gets the total number of elements currently in t.

val get : t ‑> int ‑> elt

get t i gets the element at position i.

val set : t ‑> int ‑> elt ‑> unit

set t i e sets the element at position i to e.

val sub : t ‑> int ‑> int ‑> t

sub t i len gets the sub-array of t from +position i to i + len.

val copy : t ‑> t

copy t makes a fresh copy of the array t.

val blit : t ‑> int ‑> t ‑> int ‑> int ‑> unit

blit t s arr i len copies len elements from arr starting at i +to position s from t.

val iter : (elt ‑> unit) ‑> t ‑> unit

iter f t iterates over the array t invoking f with +the current element, in array order.

\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/Make/argument-1-X/index.html b/2.3/containers/CCRingBuffer/Make/argument-1-X/index.html new file mode 100644 index 00000000..e33ec3ee --- /dev/null +++ b/2.3/containers/CCRingBuffer/Make/argument-1-X/index.html @@ -0,0 +1,2 @@ + +1-X (containers.CCRingBuffer.Make.1-X)

Parameter CCRingBuffer.Make.1-X

type t
val dummy : t
\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/Make/index.html b/2.3/containers/CCRingBuffer/Make/index.html new file mode 100644 index 00000000..73471eac --- /dev/null +++ b/2.3/containers/CCRingBuffer/Make/index.html @@ -0,0 +1,15 @@ + +Make (containers.CCRingBuffer.Make)

Module CCRingBuffer.Make

Buffer using regular arrays

Parameters

X : sig ... end

Signature

module Array : Array.S with type elt = X.t and type t = X.t array

The module type of Array for this ring buffer

type t

Defines the bounded ring buffer type

exception Empty

Raised in querying functions when the buffer is empty

val create : int ‑> t

create size creates a new bounded buffer with given size. +The underlying array is allocated immediately and no further (large) +allocation will happen from now on.

  • Raises Invalid_argument: if the argument is < 1.
val copy : t ‑> t

Make a fresh copy of the buffer.

val capacity : t ‑> int

Length of the inner buffer.

val length : t ‑> int

Number of elements currently stored in the buffer.

val is_full : t ‑> bool

true if pushing an element would erase another element.

  • Since: 1.3
val blit_from : t ‑> Array.t ‑> int ‑> int ‑> unit

blit_from buf from_buf o len copies the slice o, ... o + len - 1 from +an input buffer from_buf to the end of the buffer. +If the slice is too large for the buffer, only the last part of the array +will be copied.

  • Raises Invalid_argument: if o,len is not a valid slice of s.
val blit_into : t ‑> Array.t ‑> int ‑> int ‑> int

blit_into buf to_buf o len copies at most len elements from buf +into to_buf starting at offset o in s.

  • Returns the number of elements actually copied (min len (length buf)).
  • Raises Invalid_argument: if o,len is not a valid slice of s.
val append : t ‑> into:t ‑> unit

append b ~into copies all data from b and adds it at the +end of into. Erases data of into if there is not enough room.

val to_list : t ‑> Array.elt list

Extract the current content into a list.

val clear : t ‑> unit

Clear the content of the buffer. Doesn't actually destroy the content.

val is_empty : t ‑> bool

Is the buffer empty (i.e. contains no elements)?

val junk_front : t ‑> unit

Drop the front element from t.

  • Raises Empty: if the buffer is already empty.
val junk_back : t ‑> unit

Drop the back element from t.

  • Raises Empty: if the buffer is already empty.
val skip : t ‑> int ‑> unit

skip b len removes len elements from the front of b.

  • Raises Invalid_argument: if len > length b.
val iter : t ‑> f:(Array.elt ‑> unit) ‑> unit

iter b ~f calls f i t for each element t in buf.

val iteri : t ‑> f:(int ‑> Array.elt ‑> unit) ‑> unit

iteri b ~f calls f i t for each element t in buf, with i +being its relative index within buf.

val get_front : t ‑> int ‑> Array.elt

get_front buf i returns the i-th element of buf from the front, i.e. +the one returned by take_front buf after i-1 calls to junk_front buf.

  • Raises Invalid_argument: if the index is invalid (> length buf).
val get_back : t ‑> int ‑> Array.elt

get_back buf i returns the i-th element of buf from the back, i.e. +the one returned by take_back buf after i-1 calls to junk_back buf.

  • Raises Invalid_argument: if the index is invalid (> length buf).
val push_back : t ‑> Array.elt ‑> unit

Push value at the back of t. +If t.bounded=false, the buffer will grow as needed, +otherwise the oldest elements are replaced first.

val peek_front : t ‑> Array.elt option

First value from front of t, without modification.

val peek_front_exn : t ‑> Array.elt

First value from front of t, without modification.

  • Raises Empty: if buffer is empty.
  • Since: 1.3
val peek_back : t ‑> Array.elt option

Get the last value from back of t, without modification.

val peek_back_exn : t ‑> Array.elt

Get the last value from back of t, without modification.

  • Raises Empty: if buffer is empty.
  • Since: 1.3
val take_back : t ‑> Array.elt option

Take and remove the last value from back of t, if any.

val take_back_exn : t ‑> Array.elt

Take and remove the last value from back of t.

  • Raises Empty: if buffer is already empty.
val take_front : t ‑> Array.elt option

Take and remove the first value from front of t, if any.

val take_front_exn : t ‑> Array.elt

Take and remove the first value from front of t.

  • Raises Empty: if buffer is already empty.
val of_array : Array.t ‑> t

Create a buffer from an initial array, but doesn't take ownership +of it (still allocates a new internal array).

  • Since: 0.11
val to_array : t ‑> Array.t

Create an array from the elements, in order.

  • Since: 0.11
\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/MakeFromArray/argument-1-A/index.html b/2.3/containers/CCRingBuffer/MakeFromArray/argument-1-A/index.html new file mode 100644 index 00000000..3d2b786e --- /dev/null +++ b/2.3/containers/CCRingBuffer/MakeFromArray/argument-1-A/index.html @@ -0,0 +1,5 @@ + +1-A (containers.CCRingBuffer.MakeFromArray.1-A)

Parameter CCRingBuffer.MakeFromArray.1-A

type elt

The element type

type t

The type of an array instance

val create : int ‑> t

Make an array of the given size, filled with dummy elements.

val length : t ‑> int

length t gets the total number of elements currently in t.

val get : t ‑> int ‑> elt

get t i gets the element at position i.

val set : t ‑> int ‑> elt ‑> unit

set t i e sets the element at position i to e.

val sub : t ‑> int ‑> int ‑> t

sub t i len gets the sub-array of t from +position i to i + len.

val copy : t ‑> t

copy t makes a fresh copy of the array t.

val blit : t ‑> int ‑> t ‑> int ‑> int ‑> unit

blit t s arr i len copies len elements from arr starting at i +to position s from t.

val iter : (elt ‑> unit) ‑> t ‑> unit

iter f t iterates over the array t invoking f with +the current element, in array order.

\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/MakeFromArray/index.html b/2.3/containers/CCRingBuffer/MakeFromArray/index.html new file mode 100644 index 00000000..8d29c593 --- /dev/null +++ b/2.3/containers/CCRingBuffer/MakeFromArray/index.html @@ -0,0 +1,15 @@ + +MakeFromArray (containers.CCRingBuffer.MakeFromArray)

Module CCRingBuffer.MakeFromArray

Makes a ring buffer module with the given array type

Parameters

Signature

module Array = A

The module type of Array for this ring buffer

type t

Defines the bounded ring buffer type

exception Empty

Raised in querying functions when the buffer is empty

val create : int ‑> t

create size creates a new bounded buffer with given size. +The underlying array is allocated immediately and no further (large) +allocation will happen from now on.

  • Raises Invalid_argument: if the argument is < 1.
val copy : t ‑> t

Make a fresh copy of the buffer.

val capacity : t ‑> int

Length of the inner buffer.

val length : t ‑> int

Number of elements currently stored in the buffer.

val is_full : t ‑> bool

true if pushing an element would erase another element.

  • Since: 1.3
val blit_from : t ‑> Array.t ‑> int ‑> int ‑> unit

blit_from buf from_buf o len copies the slice o, ... o + len - 1 from +an input buffer from_buf to the end of the buffer. +If the slice is too large for the buffer, only the last part of the array +will be copied.

  • Raises Invalid_argument: if o,len is not a valid slice of s.
val blit_into : t ‑> Array.t ‑> int ‑> int ‑> int

blit_into buf to_buf o len copies at most len elements from buf +into to_buf starting at offset o in s.

  • Returns the number of elements actually copied (min len (length buf)).
  • Raises Invalid_argument: if o,len is not a valid slice of s.
val append : t ‑> into:t ‑> unit

append b ~into copies all data from b and adds it at the +end of into. Erases data of into if there is not enough room.

val to_list : t ‑> Array.elt list

Extract the current content into a list.

val clear : t ‑> unit

Clear the content of the buffer. Doesn't actually destroy the content.

val is_empty : t ‑> bool

Is the buffer empty (i.e. contains no elements)?

val junk_front : t ‑> unit

Drop the front element from t.

  • Raises Empty: if the buffer is already empty.
val junk_back : t ‑> unit

Drop the back element from t.

  • Raises Empty: if the buffer is already empty.
val skip : t ‑> int ‑> unit

skip b len removes len elements from the front of b.

  • Raises Invalid_argument: if len > length b.
val iter : t ‑> f:(Array.elt ‑> unit) ‑> unit

iter b ~f calls f i t for each element t in buf.

val iteri : t ‑> f:(int ‑> Array.elt ‑> unit) ‑> unit

iteri b ~f calls f i t for each element t in buf, with i +being its relative index within buf.

val get_front : t ‑> int ‑> Array.elt

get_front buf i returns the i-th element of buf from the front, i.e. +the one returned by take_front buf after i-1 calls to junk_front buf.

  • Raises Invalid_argument: if the index is invalid (> length buf).
val get_back : t ‑> int ‑> Array.elt

get_back buf i returns the i-th element of buf from the back, i.e. +the one returned by take_back buf after i-1 calls to junk_back buf.

  • Raises Invalid_argument: if the index is invalid (> length buf).
val push_back : t ‑> Array.elt ‑> unit

Push value at the back of t. +If t.bounded=false, the buffer will grow as needed, +otherwise the oldest elements are replaced first.

val peek_front : t ‑> Array.elt option

First value from front of t, without modification.

val peek_front_exn : t ‑> Array.elt

First value from front of t, without modification.

  • Raises Empty: if buffer is empty.
  • Since: 1.3
val peek_back : t ‑> Array.elt option

Get the last value from back of t, without modification.

val peek_back_exn : t ‑> Array.elt

Get the last value from back of t, without modification.

  • Raises Empty: if buffer is empty.
  • Since: 1.3
val take_back : t ‑> Array.elt option

Take and remove the last value from back of t, if any.

val take_back_exn : t ‑> Array.elt

Take and remove the last value from back of t.

  • Raises Empty: if buffer is already empty.
val take_front : t ‑> Array.elt option

Take and remove the first value from front of t, if any.

val take_front_exn : t ‑> Array.elt

Take and remove the first value from front of t.

  • Raises Empty: if buffer is already empty.
val of_array : Array.t ‑> t

Create a buffer from an initial array, but doesn't take ownership +of it (still allocates a new internal array).

  • Since: 0.11
val to_array : t ‑> Array.t

Create an array from the elements, in order.

  • Since: 0.11
\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/index.html b/2.3/containers/CCRingBuffer/index.html new file mode 100644 index 00000000..54701cb5 --- /dev/null +++ b/2.3/containers/CCRingBuffer/index.html @@ -0,0 +1,3 @@ + +CCRingBuffer (containers.CCRingBuffer)

Module CCRingBuffer

Circular Buffer (Deque)

Useful for IO, or as a bounded-size alternative to Queue when +batch operations are needed.

status: experimental

Change in the API to provide only a bounded buffer since 1.3

Underlying Array

module Array : sig ... end

The abstract type for arrays

module type S : sig ... end

Ring Buffer

module Byte : S with module Array = Array.Byte

An efficient byte based ring buffer

module MakeFromArray : functor (A : Array.S) -> S with module Array = A

Makes a ring buffer module with the given array type

module Make : functor (X : sig ... end) -> S with type Array.elt = X.t and type Array.t = X.t array

Buffer using regular arrays

\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/module-type-S/Array/index.html b/2.3/containers/CCRingBuffer/module-type-S/Array/index.html new file mode 100644 index 00000000..902a9147 --- /dev/null +++ b/2.3/containers/CCRingBuffer/module-type-S/Array/index.html @@ -0,0 +1,5 @@ + +Array (containers.CCRingBuffer.S.Array)

Module CCRingBuffer.S.Array

The module type of Array for this ring buffer

type elt

The element type

type t

The type of an array instance

val create : int ‑> t

Make an array of the given size, filled with dummy elements.

val length : t ‑> int

length t gets the total number of elements currently in t.

val get : t ‑> int ‑> elt

get t i gets the element at position i.

val set : t ‑> int ‑> elt ‑> unit

set t i e sets the element at position i to e.

val sub : t ‑> int ‑> int ‑> t

sub t i len gets the sub-array of t from +position i to i + len.

val copy : t ‑> t

copy t makes a fresh copy of the array t.

val blit : t ‑> int ‑> t ‑> int ‑> int ‑> unit

blit t s arr i len copies len elements from arr starting at i +to position s from t.

val iter : (elt ‑> unit) ‑> t ‑> unit

iter f t iterates over the array t invoking f with +the current element, in array order.

\ No newline at end of file diff --git a/2.3/containers/CCRingBuffer/module-type-S/index.html b/2.3/containers/CCRingBuffer/module-type-S/index.html new file mode 100644 index 00000000..f7c0390a --- /dev/null +++ b/2.3/containers/CCRingBuffer/module-type-S/index.html @@ -0,0 +1,16 @@ + +S (containers.CCRingBuffer.S)

Module type CCRingBuffer.S

Ring Buffer

The abstract ring buffer type, made concrete by choice of +ARRAY module implementation

module Array : Array.S

The module type of Array for this ring buffer

type t

Defines the bounded ring buffer type

exception Empty

Raised in querying functions when the buffer is empty

val create : int ‑> t

create size creates a new bounded buffer with given size. +The underlying array is allocated immediately and no further (large) +allocation will happen from now on.

  • Raises Invalid_argument: if the argument is < 1.
val copy : t ‑> t

Make a fresh copy of the buffer.

val capacity : t ‑> int

Length of the inner buffer.

val length : t ‑> int

Number of elements currently stored in the buffer.

val is_full : t ‑> bool

true if pushing an element would erase another element.

  • Since: 1.3
val blit_from : t ‑> Array.t ‑> int ‑> int ‑> unit

blit_from buf from_buf o len copies the slice o, ... o + len - 1 from +an input buffer from_buf to the end of the buffer. +If the slice is too large for the buffer, only the last part of the array +will be copied.

  • Raises Invalid_argument: if o,len is not a valid slice of s.
val blit_into : t ‑> Array.t ‑> int ‑> int ‑> int

blit_into buf to_buf o len copies at most len elements from buf +into to_buf starting at offset o in s.

  • Returns the number of elements actually copied (min len (length buf)).
  • Raises Invalid_argument: if o,len is not a valid slice of s.
val append : t ‑> into:t ‑> unit

append b ~into copies all data from b and adds it at the +end of into. Erases data of into if there is not enough room.

val to_list : t ‑> Array.elt list

Extract the current content into a list.

val clear : t ‑> unit

Clear the content of the buffer. Doesn't actually destroy the content.

val is_empty : t ‑> bool

Is the buffer empty (i.e. contains no elements)?

val junk_front : t ‑> unit

Drop the front element from t.

  • Raises Empty: if the buffer is already empty.
val junk_back : t ‑> unit

Drop the back element from t.

  • Raises Empty: if the buffer is already empty.
val skip : t ‑> int ‑> unit

skip b len removes len elements from the front of b.

  • Raises Invalid_argument: if len > length b.
val iter : t ‑> f:(Array.elt ‑> unit) ‑> unit

iter b ~f calls f i t for each element t in buf.

val iteri : t ‑> f:(int ‑> Array.elt ‑> unit) ‑> unit

iteri b ~f calls f i t for each element t in buf, with i +being its relative index within buf.

val get_front : t ‑> int ‑> Array.elt

get_front buf i returns the i-th element of buf from the front, i.e. +the one returned by take_front buf after i-1 calls to junk_front buf.

  • Raises Invalid_argument: if the index is invalid (> length buf).
val get_back : t ‑> int ‑> Array.elt

get_back buf i returns the i-th element of buf from the back, i.e. +the one returned by take_back buf after i-1 calls to junk_back buf.

  • Raises Invalid_argument: if the index is invalid (> length buf).
val push_back : t ‑> Array.elt ‑> unit

Push value at the back of t. +If t.bounded=false, the buffer will grow as needed, +otherwise the oldest elements are replaced first.

val peek_front : t ‑> Array.elt option

First value from front of t, without modification.

val peek_front_exn : t ‑> Array.elt

First value from front of t, without modification.

  • Raises Empty: if buffer is empty.
  • Since: 1.3
val peek_back : t ‑> Array.elt option

Get the last value from back of t, without modification.

val peek_back_exn : t ‑> Array.elt

Get the last value from back of t, without modification.

  • Raises Empty: if buffer is empty.
  • Since: 1.3
val take_back : t ‑> Array.elt option

Take and remove the last value from back of t, if any.

val take_back_exn : t ‑> Array.elt

Take and remove the last value from back of t.

  • Raises Empty: if buffer is already empty.
val take_front : t ‑> Array.elt option

Take and remove the first value from front of t, if any.

val take_front_exn : t ‑> Array.elt

Take and remove the first value from front of t.

  • Raises Empty: if buffer is already empty.
val of_array : Array.t ‑> t

Create a buffer from an initial array, but doesn't take ownership +of it (still allocates a new internal array).

  • Since: 0.11
val to_array : t ‑> Array.t

Create an array from the elements, in order.

  • Since: 0.11
\ No newline at end of file diff --git a/2.3/containers/CCSemaphore/.jbuilder-keep b/2.3/containers/CCSemaphore/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCSemaphore/index.html b/2.3/containers/CCSemaphore/index.html new file mode 100644 index 00000000..3faa68b0 --- /dev/null +++ b/2.3/containers/CCSemaphore/index.html @@ -0,0 +1,6 @@ + +CCSemaphore (containers.CCSemaphore)

Module CCSemaphore

Semaphores

type t

A semaphore

val create : int ‑> t

create n creates a semaphore with initial value n.

  • Raises Invalid_argument: if n <= 0.
val get : t ‑> int

Current value.

val acquire : int ‑> t ‑> unit

acquire n s blocks until get s >= n, then atomically +sets s := !s - n.

val release : int ‑> t ‑> unit

release n s atomically sets s := !s + n.

val with_acquire : n:int ‑> t ‑> f:(unit ‑> 'a) ‑> 'a

with_acquire ~n s ~f first acquires s with n units, +calls f (), and then releases s with n units. +Safely release the semaphore even if f () fails.

val wait_until_at_least : n:int ‑> t ‑> f:(unit ‑> 'a) ‑> 'a

wait_until_at_least ~n s ~f waits until get s >= n, then calls f () +and returns its result. Doesn't modify the semaphore.

\ No newline at end of file diff --git a/2.3/containers/CCSet/.jbuilder-keep b/2.3/containers/CCSet/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCSet/index.html b/2.3/containers/CCSet/index.html new file mode 100644 index 00000000..55922017 --- /dev/null +++ b/2.3/containers/CCSet/index.html @@ -0,0 +1,2 @@ + +CCSet (containers.CCSet)

Module CCSet

Wrapper around Set

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a printer = Format.formatter ‑> 'a ‑> unit
module type OrderedType = Set.OrderedType
module type S : sig ... end
module Make : functor (O : Set.OrderedType) -> S with type Make.t = Set.Make(O).t and type Make.elt = O.t
\ No newline at end of file diff --git a/2.3/containers/CCSet/module-type-S/index.html b/2.3/containers/CCSet/module-type-S/index.html new file mode 100644 index 00000000..938d6901 --- /dev/null +++ b/2.3/containers/CCSet/module-type-S/index.html @@ -0,0 +1,3 @@ + +S (containers.CCSet.S)

Module type CCSet.S

include Set.S
type elt
type t
val empty : t
val is_empty : t ‑> bool
val mem : elt ‑> t ‑> bool
val add : elt ‑> t ‑> t
val singleton : elt ‑> t
val remove : elt ‑> t ‑> t
val union : t ‑> t ‑> t
val inter : t ‑> t ‑> t
val diff : t ‑> t ‑> t
val compare : t ‑> t ‑> int
val equal : t ‑> t ‑> bool
val subset : t ‑> t ‑> bool
val iter : (elt ‑> unit) ‑> t ‑> unit
val map : (elt ‑> elt) ‑> t ‑> t
val fold : (elt ‑> 'a ‑> 'a) ‑> t ‑> 'a ‑> 'a
val for_all : (elt ‑> bool) ‑> t ‑> bool
val exists : (elt ‑> bool) ‑> t ‑> bool
val filter : (elt ‑> bool) ‑> t ‑> t
val partition : (elt ‑> bool) ‑> t ‑> t * t
val cardinal : t ‑> int
val elements : t ‑> elt list
val min_elt : t ‑> elt
val min_elt_opt : t ‑> elt option
val max_elt : t ‑> elt
val max_elt_opt : t ‑> elt option
val choose : t ‑> elt
val choose_opt : t ‑> elt option
val split : elt ‑> t ‑> t * bool * t
val find : elt ‑> t ‑> elt
val find_opt : elt ‑> t ‑> elt option
val find_first : (elt ‑> bool) ‑> t ‑> elt
val find_first_opt : (elt ‑> bool) ‑> t ‑> elt option
val find_last : (elt ‑> bool) ‑> t ‑> elt
val find_last_opt : (elt ‑> bool) ‑> t ‑> elt option
val of_list : elt list ‑> t
val min_elt_opt : t ‑> elt option

Safe version of min_elt.

  • Since: 1.5
val max_elt_opt : t ‑> elt option

Safe version of max_elt.

  • Since: 1.5
val choose_opt : t ‑> elt option

Safe version of choose.

  • Since: 1.5
val find_opt : elt ‑> t ‑> elt option

Safe version of find.

  • Since: 1.5
val find_first : (elt ‑> bool) ‑> t ‑> elt

Find minimum element satisfying predicate.

  • Since: 1.5
val find_first_opt : (elt ‑> bool) ‑> t ‑> elt option

Safe version of find_first.

  • Since: 1.5
val find_last : (elt ‑> bool) ‑> t ‑> elt

Find maximum element satisfying predicate.

  • Since: 1.5
val find_last_opt : (elt ‑> bool) ‑> t ‑> elt option

Safe version of find_last.

  • Since: 1.5
val of_seq : elt sequence ‑> t

Build a set from the given sequence of elements.

val add_seq : t ‑> elt sequence ‑> t
  • Since: 0.14
val to_seq : t ‑> elt sequence

to_seq t converts the set t to a sequence of the elements.

val of_list : elt list ‑> t

Build a set from the given list of elements, +added in order using add.

val add_list : t ‑> elt list ‑> t
  • Since: 0.14
val to_list : t ‑> elt list

to_list t converts the set t to a list of the elements.

val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> elt printer ‑> t printer

Print the set.

\ No newline at end of file diff --git a/2.3/containers/CCSexp/.jbuilder-keep b/2.3/containers/CCSexp/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCSexp/Decoder/index.html b/2.3/containers/CCSexp/Decoder/index.html new file mode 100644 index 00000000..27b6071a --- /dev/null +++ b/2.3/containers/CCSexp/Decoder/index.html @@ -0,0 +1,3 @@ + +Decoder (containers.CCSexp.Decoder)

Module CCSexp.Decoder

type t

Decoder

val of_lexbuf : Lexing.lexbuf ‑> t
val next : t ‑> sexp parse_result

Parse the next S-expression or return an error if the input isn't +long enough or isn't a proper S-expression.

\ No newline at end of file diff --git a/2.3/containers/CCSexp/index.html b/2.3/containers/CCSexp/index.html new file mode 100644 index 00000000..4f270207 --- /dev/null +++ b/2.3/containers/CCSexp/index.html @@ -0,0 +1,8 @@ + +CCSexp (containers.CCSexp)

Module CCSexp

Handling S-expressions

type 'a or_error = ('a, string) Result.result
type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option

Basics

type t = [
| `Atom of string
| `List of t list
]
type sexp = t
val equal : t ‑> t ‑> bool
val compare : t ‑> t ‑> int
val hash : t ‑> int
val atom : string ‑> t

Build an atom directly from a string.

val of_int : int ‑> t
val of_bool : bool ‑> t
val of_list : t list ‑> t
val of_rev_list : t list ‑> t

Reverse the list.

val of_float : float ‑> t

Reverse the list.

val of_unit : t
val of_pair : (t * t) ‑> t
val of_triple : (t * t * t) ‑> t
val of_quad : (t * t * t * t) ‑> t
val of_variant : string ‑> t list ‑> t

of_variant name args is used to encode algebraic variants +into a S-expr. For instance of_variant "some" [of_int 1] +represents the value Some 1.

val of_field : string ‑> t ‑> t

Used to represent one record field.

val of_record : (string * t) list ‑> t

Represent a record by its named fields.

Printing

val to_buf : Buffer.t ‑> t ‑> unit
val to_string : t ‑> string
val to_file : string ‑> t ‑> unit
val to_file_seq : string ‑> t sequence ‑> unit

Print the given sequence of expressions to a file.

val to_chan : Pervasives.out_channel ‑> t ‑> unit
val pp : Format.formatter ‑> t ‑> unit

Pretty-printer nice on human eyes (including indentation).

val pp_noindent : Format.formatter ‑> t ‑> unit

Raw, direct printing as compact as possible.

Parsing

type 'a parse_result =
| Yield of 'a
| Fail of string
| End

A parser of 'a can return Yield x when it parsed a value, +or Fail e when a parse error was encountered, or +End if the input was empty.

module Decoder : sig ... end
val parse_string : string ‑> t or_error

Parse a string.

val parse_chan : Pervasives.in_channel ‑> t or_error

Parse a S-expression from the given channel. Can read more data than +necessary, so don't use this if you need finer-grained control (e.g. +to read something else after the S-exp).

val parse_chan_gen : Pervasives.in_channel ‑> t or_error gen

Parse a channel into a generator of S-expressions.

val parse_chan_list : Pervasives.in_channel ‑> t list or_error
val parse_file : string ‑> t or_error

Open the file and read a S-exp from it.

val parse_file_list : string ‑> t list or_error

Open the file and read a S-exp from it.

\ No newline at end of file diff --git a/2.3/containers/CCSexp_lex/.jbuilder-keep b/2.3/containers/CCSexp_lex/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCSexp_lex/index.html b/2.3/containers/CCSexp_lex/index.html new file mode 100644 index 00000000..61074d6b --- /dev/null +++ b/2.3/containers/CCSexp_lex/index.html @@ -0,0 +1,2 @@ + +CCSexp_lex (containers.CCSexp_lex)

Module CCSexp_lex

type token =
| ATOM of string
| LIST_OPEN
| LIST_CLOSE
| EOI
exception Error of int * int * string
val error : Lexing.lexbuf ‑> string ‑> 'a
type unescape_state =
| Not_escaped
| Escaped
| Escaped_int_1 of int
| Escaped_int_2 of int
val char_equal : char ‑> char ‑> bool
val remove_quotes : Lexing.lexbuf ‑> string ‑> string
val __ocaml_lex_tables : Lexing.lex_tables
val token : Lexing.lexbuf ‑> token
val __ocaml_lex_token_rec : Lexing.lexbuf ‑> int ‑> token
\ No newline at end of file diff --git a/2.3/containers/CCSimple_queue/.jbuilder-keep b/2.3/containers/CCSimple_queue/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCSimple_queue/Infix/index.html b/2.3/containers/CCSimple_queue/Infix/index.html new file mode 100644 index 00000000..16d9a506 --- /dev/null +++ b/2.3/containers/CCSimple_queue/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCSimple_queue.Infix)

Module CCSimple_queue.Infix

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Alias to map.

val (@) : 'a t ‑> 'a t ‑> 'a t

Alias to append.

val (<::) : 'a t ‑> 'a ‑> 'a t

Alias to snoc.

\ No newline at end of file diff --git a/2.3/containers/CCSimple_queue/index.html b/2.3/containers/CCSimple_queue/index.html new file mode 100644 index 00000000..8da24e45 --- /dev/null +++ b/2.3/containers/CCSimple_queue/index.html @@ -0,0 +1,4 @@ + +CCSimple_queue (containers.CCSimple_queue)

Module CCSimple_queue

Functional queues (fifo)

Simple implementation of functional queues

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a gen = unit ‑> 'a option
type +'a t

Queue containing elements of type 'a

val empty : 'a t
val is_empty : 'a t ‑> bool
val push : 'a ‑> 'a t ‑> 'a t

Push element at the end of the queue.

val snoc : 'a t ‑> 'a ‑> 'a t

Flip version of push.

val peek : 'a t ‑> 'a option

First element of the queue.

val peek_exn : 'a t ‑> 'a

Same as peek but

  • Raises Invalid_argument: if the queue is empty.
val pop : 'a t ‑> ('a * 'a t) option

Get and remove the first element.

val pop_exn : 'a t ‑> 'a * 'a t

Same as pop, but fails on empty queues.

  • Raises Invalid_argument: if the queue is empty.
val junk : 'a t ‑> 'a t

Remove first element. If the queue is empty, do nothing.

val append : 'a t ‑> 'a t ‑> 'a t

Append two queues. Elements from the second one come +after elements of the first one. +Linear in the size of the second queue.

val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Map values.

val rev : 'a t ‑> 'a t

Reverse the queue. Constant time.

val equal : ('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool
module Infix : sig ... end
include module type of Infix
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Alias to map.

val (@) : 'a t ‑> 'a t ‑> 'a t

Alias to append.

val (<::) : 'a t ‑> 'a ‑> 'a t

Alias to snoc.

val length : 'a t ‑> int

Number of elements in the queue (linear in time).

val fold : ('b ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b
val iter : ('a ‑> unit) ‑> 'a t ‑> unit
val to_list : 'a t ‑> 'a list
val add_list : 'a t ‑> 'a list ‑> 'a t
val of_list : 'a list ‑> 'a t
val to_seq : 'a t ‑> 'a sequence
val add_seq : 'a t ‑> 'a sequence ‑> 'a t
val of_seq : 'a sequence ‑> 'a t
val to_klist : 'a t ‑> 'a klist
val add_klist : 'a t ‑> 'a klist ‑> 'a t
val of_klist : 'a klist ‑> 'a t
val of_gen : 'a gen ‑> 'a t
val add_gen : 'a t ‑> 'a gen ‑> 'a t
val to_gen : 'a t ‑> 'a gen

IO

val pp : ?⁠sep:unit printer ‑> 'a printer ‑> 'a t printer
\ No newline at end of file diff --git a/2.3/containers/CCString/.jbuilder-keep b/2.3/containers/CCString/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCString/Find/index.html b/2.3/containers/CCString/Find/index.html new file mode 100644 index 00000000..b2e36b81 --- /dev/null +++ b/2.3/containers/CCString/Find/index.html @@ -0,0 +1,2 @@ + +Find (containers.CCString.Find)

Module CCString.Find

type _ pattern
val compile : string ‑> [ `Direct ] pattern
val rcompile : string ‑> [ `Reverse ] pattern
val find : ?⁠start:int ‑> pattern:[ `Direct ] pattern ‑> string ‑> int

Search for pattern in the string, left-to-right.

  • Returns the offset of the first match, -1 otherwise.
  • Parameter start: offset in string at which we start.
val rfind : ?⁠start:int ‑> pattern:[ `Reverse ] pattern ‑> string ‑> int

Search for pattern in the string, right-to-left.

  • Returns the offset of the start of the first match from the right, -1 otherwise.
  • Parameter start: right-offset in string at which we start.
\ No newline at end of file diff --git a/2.3/containers/CCString/Split/index.html b/2.3/containers/CCString/Split/index.html new file mode 100644 index 00000000..c3d894e5 --- /dev/null +++ b/2.3/containers/CCString/Split/index.html @@ -0,0 +1,9 @@ + +Split (containers.CCString.Split)

Module CCString.Split

type drop_if_empty = {
first : bool;
last : bool;
}

Specification of what to do with empty blocks, as in split ~by:"-" "-a-b-".

  • {first=false; last=false} will return ""; "a"; "b"; ""
  • {first=true; last=false} will return "a"; "b" ""
  • {first=false; last=true} will return ""; "a"; "b"
  • {first=true; last=true} will return "a"; "b"

The default value of all remaining functions is Drop_none.

  • Since: 1.5
val no_drop : drop_if_empty

Do not drop any group, even empty and on borders.

  • Since: 1.5
val list_ : ?⁠drop:drop_if_empty ‑> by:string ‑> string ‑> (string * int * int) list

Split the given string along the given separator by. Should only +be used with very small separators, otherwise +use Containers_string.KMP.

  • Returns a list of slices (s,index,length) that are +separated by by. String.sub can then be used to actually extract +a string from the slice.
  • Raises Failure: if by = "".
val gen : ?⁠drop:drop_if_empty ‑> by:string ‑> string ‑> (string * int * int) gen
val seq : ?⁠drop:drop_if_empty ‑> by:string ‑> string ‑> (string * int * int) sequence
val klist : ?⁠drop:drop_if_empty ‑> by:string ‑> string ‑> (string * int * int) klist
Copying functions

Those split functions actually copy the substrings, which can be +more convenient but less efficient in general.

val list_cpy : ?⁠drop:drop_if_empty ‑> by:string ‑> string ‑> string list
val gen_cpy : ?⁠drop:drop_if_empty ‑> by:string ‑> string ‑> string gen
val seq_cpy : ?⁠drop:drop_if_empty ‑> by:string ‑> string ‑> string sequence
val klist_cpy : ?⁠drop:drop_if_empty ‑> by:string ‑> string ‑> string klist
val left : by:string ‑> string ‑> (string * string) option

Split on the first occurrence of by from the leftmost part of +the string.

  • Since: 0.12
val left_exn : by:string ‑> string ‑> string * string

Split on the first occurrence of by from the leftmost part of the string.

  • Raises Not_found: if by is not part of the string.
  • Since: 0.16
val right : by:string ‑> string ‑> (string * string) option

Split on the first occurrence of by from the rightmost part of +the string.

  • Since: 0.12
val right_exn : by:string ‑> string ‑> string * string

Split on the first occurrence of by from the rightmost part of the string.

  • Raises Not_found: if by is not part of the string.
  • Since: 0.16
\ No newline at end of file diff --git a/2.3/containers/CCString/Sub/index.html b/2.3/containers/CCString/Sub/index.html new file mode 100644 index 00000000..7dfdd05c --- /dev/null +++ b/2.3/containers/CCString/Sub/index.html @@ -0,0 +1,3 @@ + +Sub (containers.CCString.Sub)

Module CCString.Sub

type t = string * int * int

A string, an offset, and the length of the slice.

val make : string ‑> int ‑> len:int ‑> t
val full : string ‑> t

Full string.

val copy : t ‑> string

Make a copy of the substring.

val underlying : t ‑> string
val sub : t ‑> int ‑> int ‑> t

Sub-slice.

val get : t ‑> int ‑> char

get s i gets the i-th element, or fails.

  • Raises Invalid_argument: if the index is not within 0 ... length - 1.
  • Since: 1.2
include S with type t := t
type t
val length : t ‑> int

Return the length (number of characters) of the given string.

val blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unit

Like String.blit. +Compatible with the -safe-string option.

  • Raises Invalid_argument: if indices are not valid.
val fold : ('a ‑> char ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on chars by increasing index.

  • Since: 0.7

Conversions

val to_gen : t ‑> char gen

Return the gen of characters contained in the string.

val to_seq : t ‑> char sequence

Return the sequence of characters contained in the string.

val to_klist : t ‑> char klist

Return the klist of characters contained in the string.

val to_list : t ‑> char list

Return the list of characters contained in the string.

val pp_buf : Buffer.t ‑> t ‑> unit

Renamed from pp since 2.0.

val pp : Format.formatter ‑> t ‑> unit

Print the string within quotes.

Renamed from print since 2.0.

\ No newline at end of file diff --git a/2.3/containers/CCString/index.html b/2.3/containers/CCString/index.html new file mode 100644 index 00000000..4aa59dd8 --- /dev/null +++ b/2.3/containers/CCString/index.html @@ -0,0 +1,22 @@ + +CCString (containers.CCString)

Module CCString

Basic String Utils

type 'a gen = unit ‑> 'a option
type 'a sequence = ('a ‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]

Common Signature

module type S : sig ... end

Strings

include module type of sig ... end
external length : string ‑> int = "%string_length"
external get : string ‑> int ‑> char = "%string_safe_get"
external set : bytes ‑> int ‑> char ‑> unit = "%string_safe_set"
  • Deprecated Use Bytes.set instead.
external create : int ‑> bytes = "caml_create_string"
  • Deprecated Use Bytes.create instead.
val make : int ‑> char ‑> string
val init : int ‑> (int ‑> char) ‑> string
val copy : string ‑> string
val sub : string ‑> int ‑> int ‑> string
val fill : bytes ‑> int ‑> int ‑> char ‑> unit
  • Deprecated Use Bytes.fill instead.
val blit : string ‑> int ‑> bytes ‑> int ‑> int ‑> unit
val concat : string ‑> string list ‑> string
val iter : (char ‑> unit) ‑> string ‑> unit
val iteri : (int ‑> char ‑> unit) ‑> string ‑> unit
val map : (char ‑> char) ‑> string ‑> string
val mapi : (int ‑> char ‑> char) ‑> string ‑> string
val trim : string ‑> string
val escaped : string ‑> string
val index : string ‑> char ‑> int
val index_opt : string ‑> char ‑> int option
val rindex : string ‑> char ‑> int
val rindex_opt : string ‑> char ‑> int option
val index_from : string ‑> int ‑> char ‑> int
val index_from_opt : string ‑> int ‑> char ‑> int option
val rindex_from : string ‑> int ‑> char ‑> int
val rindex_from_opt : string ‑> int ‑> char ‑> int option
val contains : string ‑> char ‑> bool
val contains_from : string ‑> int ‑> char ‑> bool
val rcontains_from : string ‑> int ‑> char ‑> bool
val uppercase : string ‑> string
  • Deprecated Use String.uppercase_ascii instead.
val lowercase : string ‑> string
  • Deprecated Use String.lowercase_ascii instead.
val capitalize : string ‑> string
  • Deprecated Use String.capitalize_ascii instead.
val uncapitalize : string ‑> string
  • Deprecated Use String.uncapitalize_ascii instead.
val uppercase_ascii : string ‑> string
val lowercase_ascii : string ‑> string
val capitalize_ascii : string ‑> string
val uncapitalize_ascii : string ‑> string
type t = string
val compare : t ‑> t ‑> int
val equal : t ‑> t ‑> bool
val split_on_char : char ‑> string ‑> string list
external unsafe_get : string ‑> int ‑> char = "%string_unsafe_get"
external unsafe_set : bytes ‑> int ‑> char ‑> unit = "%string_unsafe_set"
external unsafe_blit : string ‑> int ‑> bytes ‑> int ‑> int ‑> unit = "caml_blit_string"
external unsafe_fill : bytes ‑> int ‑> int ‑> char ‑> unit = "caml_fill_string"
val equal : string ‑> string ‑> bool

Equality function on strings.

val compare : string ‑> string ‑> int
val is_empty : string ‑> bool

is_empty s returns true iff s is empty (i.e. its length is 0).

  • Since: 1.5
val hash : string ‑> int
val init : int ‑> (int ‑> char) ‑> string

Like Array.init.

  • Since: 0.3.3
val rev : string ‑> string

rev s returns the reverse of s.

  • Since: 0.17
val pad : ?⁠side:[ `Left | `Right ] ‑> ?⁠c:char ‑> int ‑> string ‑> string

pad n str ensures that str is at least n bytes long, +and pads it on the side with c if it's not the case.

  • Parameter side: determines where padding occurs (default: `Left).
  • Parameter c: the char used to pad (default: ' ').
  • Since: 0.17
val of_char : char ‑> string

of_char 'a' is "a".

  • Since: 0.19
val of_gen : char gen ‑> string

Convert a gen of characters to a string.

val of_seq : char sequence ‑> string

Convert a sequence of characters to a string.

val of_klist : char klist ‑> string

Convert a klist of characters to a string.

val of_list : char list ‑> string

Convert a list of characters to a string.

val of_array : char array ‑> string

Convert an array of characters to a string.

val to_array : string ‑> char array

Return the array of characters contained in the string.

val find : ?⁠start:int ‑> sub:string ‑> string ‑> int

Find sub in string, returns its first index or -1.

val find_all : ?⁠start:int ‑> sub:string ‑> string ‑> int gen

find_all ~sub s finds all occurrences of sub in s, even overlapping +instances.

  • Parameter start: starting position in s.
  • Since: 0.17
val find_all_l : ?⁠start:int ‑> sub:string ‑> string ‑> int list

find_all_l ~sub s finds all occurrences of sub in s and returns +them in a list.

  • Parameter start: starting position in s.
  • Since: 0.17
val mem : ?⁠start:int ‑> sub:string ‑> string ‑> bool

mem ~sub s is true iff sub is a substring of s.

  • Since: 0.12
val rfind : sub:string ‑> string ‑> int

Find sub in string from the right, returns its first index or -1. +Should only be used with very small sub.

  • Since: 0.12
val replace : ?⁠which:[ `Left | `Right | `All ] ‑> sub:string ‑> by:string ‑> string ‑> string

replace ~sub ~by s replaces some occurrences of sub by by in s.

  • Parameter which: decides whether the occurrences to replace are: +

    • `Left first occurrence from the left (beginning).
    • `Right first occurrence from the right (end).
    • `All all occurrences (default).
  • Raises Invalid_argument: if sub = "".
  • Since: 0.14
val is_sub : sub:string ‑> int ‑> string ‑> int ‑> len:int ‑> bool

is_sub ~sub i s j ~len returns true iff the substring of +sub starting at position i and of length len is a substring +of s starting at position j.

val repeat : string ‑> int ‑> string

The same string, repeated n times.

val prefix : pre:string ‑> string ‑> bool

prefix ~pre s returns true iff pre is a prefix of s.

val suffix : suf:string ‑> string ‑> bool

suffix ~suf s returns true iff suf is a suffix of s.

  • Since: 0.7
val chop_prefix : pre:string ‑> string ‑> string option

chop_prefix ~pre s removes pre from s if pre really is a prefix +of s, returns None otherwise.

  • Since: 0.17
val chop_suffix : suf:string ‑> string ‑> string option

chop_suffix ~suf s removes suf from s if suf really is a suffix +of s, returns None otherwise.

  • Since: 0.17
val take : int ‑> string ‑> string

take n s keeps only the n first chars of s.

  • Since: 0.17
val drop : int ‑> string ‑> string

drop n s removes the n first chars of s.

  • Since: 0.17
val take_drop : int ‑> string ‑> string * string

take_drop n s = take n s, drop n s.

  • Since: 0.17
val lines : string ‑> string list

lines s returns a list of the lines of s (splits along '\n').

  • Since: 0.10
val lines_gen : string ‑> string gen

lines_gen s returns a generator of the lines of s (splits along '\n').

  • Since: 0.10
val concat_gen : sep:string ‑> string gen ‑> string

concat_gen ~sep g concatenates all strings of g, separated with sep.

  • Since: 0.10
val unlines : string list ‑> string

unlines l concatenates all strings of l, separated with '\n'.

  • Since: 0.10
val unlines_gen : string gen ‑> string

unlines_gen g concatenates all strings of g, separated with '\n'.

  • Since: 0.10
val set : string ‑> int ‑> char ‑> string

set s i c creates a new string which is a copy of s, except +for index i, which becomes c.

  • Raises Invalid_argument: if i is an invalid index.
  • Since: 0.12
val iter : (char ‑> unit) ‑> string ‑> unit

Alias to String.iter.

  • Since: 0.12
val iteri : (int ‑> char ‑> unit) ‑> string ‑> unit

Iter on chars with their index.

  • Since: 0.12
val map : (char ‑> char) ‑> string ‑> string

Map chars.

  • Since: 0.12
val mapi : (int ‑> char ‑> char) ‑> string ‑> string

Map chars with their index.

  • Since: 0.12
val filter_map : (char ‑> char option) ‑> string ‑> string

filter_map f s calls (f a0) (f a1) ... (f an) where a0 ... an are the characters of s. +It returns the string of characters ci such as f ai = Some ci (when f returns None, +the corresponding element of s is discarded).

  • Since: 0.17
val filter : (char ‑> bool) ‑> string ‑> string

filter f s discards characters not satisfying f.

  • Since: 0.17
val flat_map : ?⁠sep:string ‑> (char ‑> string) ‑> string ‑> string

Map each chars to a string, then concatenates them all.

  • Parameter sep: optional separator between each generated string.
  • Since: 0.12
val for_all : (char ‑> bool) ‑> string ‑> bool

True for all chars?

  • Since: 0.12
val exists : (char ‑> bool) ‑> string ‑> bool

True for some char?

  • Since: 0.12
include S with type S.t := string
type t
val length : t ‑> int

Return the length (number of characters) of the given string.

val blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unit

Like String.blit. +Compatible with the -safe-string option.

  • Raises Invalid_argument: if indices are not valid.
val fold : ('a ‑> char ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on chars by increasing index.

  • Since: 0.7

Conversions

val to_gen : t ‑> char gen

Return the gen of characters contained in the string.

val to_seq : t ‑> char sequence

Return the sequence of characters contained in the string.

val to_klist : t ‑> char klist

Return the klist of characters contained in the string.

val to_list : t ‑> char list

Return the list of characters contained in the string.

val pp_buf : Buffer.t ‑> t ‑> unit

Renamed from pp since 2.0.

val pp : Format.formatter ‑> t ‑> unit

Print the string within quotes.

Renamed from print since 2.0.

val drop_while : (char ‑> bool) ‑> t ‑> t

drop_while f s discards any characters starting from the left, +up to the first character c not satisfying f c.

  • Since: 2.2
val rdrop_while : (char ‑> bool) ‑> t ‑> t

rdrop_while f s discards any characters starting from the right, +up to the first character c not satisfying f c.

  • Since: 2.2
val ltrim : t ‑> t

Trim space on the left (see String.trim for more details).

  • Since: 1.2
val rtrim : t ‑> t

Trim space on the right (see String.trim for more details).

  • Since: 1.2

Operations on 2 strings

val map2 : (char ‑> char ‑> char) ‑> string ‑> string ‑> string

Map pairs of chars.

  • Raises Invalid_argument: if the strings have not the same length.
  • Since: 0.12
val iter2 : (char ‑> char ‑> unit) ‑> string ‑> string ‑> unit

Iterate on pairs of chars.

  • Raises Invalid_argument: if the strings have not the same length.
  • Since: 0.12
val iteri2 : (int ‑> char ‑> char ‑> unit) ‑> string ‑> string ‑> unit

Iterate on pairs of chars with their index.

  • Raises Invalid_argument: if the strings have not the same length.
  • Since: 0.12
val fold2 : ('a ‑> char ‑> char ‑> 'a) ‑> 'a ‑> string ‑> string ‑> 'a

Fold on pairs of chars.

  • Raises Invalid_argument: if the strings have not the same length.
  • Since: 0.12
val for_all2 : (char ‑> char ‑> bool) ‑> string ‑> string ‑> bool

All pairs of chars respect the predicate?

  • Raises Invalid_argument: if the strings have not the same length.
  • Since: 0.12
val exists2 : (char ‑> char ‑> bool) ‑> string ‑> string ‑> bool

Exists a pair of chars?

  • Raises Invalid_argument: if the strings have not the same length.
  • Since: 0.12

Ascii functions

Those functions are deprecated in String since 4.03, so we provide +a stable alias for them even in older versions.

val capitalize_ascii : string ‑> string

See String.

  • Since: 0.18
val uncapitalize_ascii : string ‑> string

See String.

  • Since: 0.18
val uppercase_ascii : string ‑> string

See String.

  • Since: 0.18
val lowercase_ascii : string ‑> string

See String.

  • Since: 0.18
val equal_caseless : string ‑> string ‑> bool

Comparison without respect to ascii lowercase.

  • Since: 1.2

Finding

A relatively efficient algorithm for finding sub-strings.

module Find : sig ... end

Splitting

module Split : sig ... end
val split_on_char : char ‑> string ‑> string list

Split the string along the given char.

  • Since: 1.2
val split : by:string ‑> string ‑> string list

Alias to Split.list_cpy.

  • Since: 1.2

Utils

val compare_versions : string ‑> string ‑> int

compare_versions a b compares version strings a and b, +considering that numbers are above text.

  • Since: 0.13
val compare_natural : string ‑> string ‑> int

Natural Sort Order, comparing chunks of digits as natural numbers. +https://en.wikipedia.org/wiki/Natural_sort_order

  • Since: 1.3
val edit_distance : string ‑> string ‑> int

Edition distance between two strings. This satisfies the classical +distance axioms: it is always positive, symmetric, and satisfies +the formula distance a b + distance b c >= distance a c.

Slices

A contiguous part of a string

module Sub : sig ... end
\ No newline at end of file diff --git a/2.3/containers/CCString/module-type-S/index.html b/2.3/containers/CCString/module-type-S/index.html new file mode 100644 index 00000000..e91d8c6d --- /dev/null +++ b/2.3/containers/CCString/module-type-S/index.html @@ -0,0 +1,3 @@ + +S (containers.CCString.S)

Module type CCString.S

type t
val length : t ‑> int

Return the length (number of characters) of the given string.

val blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unit

Like String.blit. +Compatible with the -safe-string option.

  • Raises Invalid_argument: if indices are not valid.
val fold : ('a ‑> char ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on chars by increasing index.

  • Since: 0.7

Conversions

val to_gen : t ‑> char gen

Return the gen of characters contained in the string.

val to_seq : t ‑> char sequence

Return the sequence of characters contained in the string.

val to_klist : t ‑> char klist

Return the klist of characters contained in the string.

val to_list : t ‑> char list

Return the list of characters contained in the string.

val pp_buf : Buffer.t ‑> t ‑> unit

Renamed from pp since 2.0.

val pp : Format.formatter ‑> t ‑> unit

Print the string within quotes.

Renamed from print since 2.0.

\ No newline at end of file diff --git a/2.3/containers/CCThread/.jbuilder-keep b/2.3/containers/CCThread/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCThread/Arr/index.html b/2.3/containers/CCThread/Arr/index.html new file mode 100644 index 00000000..47a52d0e --- /dev/null +++ b/2.3/containers/CCThread/Arr/index.html @@ -0,0 +1,3 @@ + +Arr (containers.CCThread.Arr)

Module CCThread.Arr

Array of threads

val spawn : int ‑> (int ‑> 'a) ‑> t array

Arr.spawn n f creates an array res of length n, such that +res.(i) = spawn (fun () -> f i).

val join : t array ‑> unit

Arr.join a joins every thread in a.

\ No newline at end of file diff --git a/2.3/containers/CCThread/Barrier/index.html b/2.3/containers/CCThread/Barrier/index.html new file mode 100644 index 00000000..355e13fc --- /dev/null +++ b/2.3/containers/CCThread/Barrier/index.html @@ -0,0 +1,6 @@ + +Barrier (containers.CCThread.Barrier)

Module CCThread.Barrier

type t

Barrier, used to synchronize threads

val create : unit ‑> t

Create a barrier.

val reset : t ‑> unit

Reset to initial (non-triggered) state.

val wait : t ‑> unit

wait b waits for barrier b to be activated by activate b. +All threads calling this wait until activate b is called. +If b is already activated, wait b does nothing.

val activate : t ‑> unit

activate b unblocks all threads that were waiting on b.

val activated : t ‑> bool

activated b returns true iff activate b was called, and reset b +was not called since. In other words, activated b = true means +wait b will not block.

\ No newline at end of file diff --git a/2.3/containers/CCThread/index.html b/2.3/containers/CCThread/index.html new file mode 100644 index 00000000..7de06e85 --- /dev/null +++ b/2.3/containers/CCThread/index.html @@ -0,0 +1,2 @@ + +CCThread (containers.CCThread)

Module CCThread

Threads

status: unstable

type t = Thread.t
val spawn : (unit ‑> _) ‑> t

spawn f creates a new thread that runs f ().

val spawn1 : ('a ‑> _) ‑> 'a ‑> t

spawn1 f x is like spawn (fun () -> f x).

  • Since: 0.16
val spawn2 : ('a ‑> 'b ‑> _) ‑> 'a ‑> 'b ‑> t

spawn2 f x y is like spawn (fun () -> f x y).

  • Since: 0.16
val detach : (unit ‑> 'a) ‑> unit

detach f is the same as ignore (spawn f).

module Arr : sig ... end

Array of threads

Single-Use Barrier

module Barrier : sig ... end
\ No newline at end of file diff --git a/2.3/containers/CCTimer/.jbuilder-keep b/2.3/containers/CCTimer/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCTimer/index.html b/2.3/containers/CCTimer/index.html new file mode 100644 index 00000000..9119e03e --- /dev/null +++ b/2.3/containers/CCTimer/index.html @@ -0,0 +1,6 @@ + +CCTimer (containers.CCTimer)

Module CCTimer

Event timer

Used to be part of CCFuture.

type t

A scheduler for events. It runs in its own thread.

val create : unit ‑> t

A new timer.

val set_exn_handler : t ‑> (exn ‑> unit) ‑> unit

set_exn_handler timer f registers f so that any exception +raised by a task scheduled in timer is given to f.

exception Stopped
val after : t ‑> float ‑> f:(unit ‑> _) ‑> unit

Call the callback f after the given number of seconds.

  • Raises Stopped: if the timer was stopped.
val at : t ‑> float ‑> f:(unit ‑> _) ‑> unit

Create a future that evaluates to () at the given Unix timestamp.

  • Raises Stopped: if the timer was stopped.
exception ExitEvery
val every : ?⁠delay:float ‑> t ‑> float ‑> f:(unit ‑> _) ‑> unit

every timer n ~f calls f () every n seconds. +f() can raise ExitEvery to stop the cycle.

  • Parameter delay: if provided, the first call to f () is delayed by +that many seconds.
  • Raises Stopped: if the timer was stopped.
val stop : t ‑> unit

Stop the given timer, cancelling pending tasks. Idempotent. +From now on, calling most other operations on the timer will raise Stopped.

val active : t ‑> bool

Return true until stop t has been called.

\ No newline at end of file diff --git a/2.3/containers/CCTrie/.jbuilder-keep b/2.3/containers/CCTrie/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCTrie/Make/argument-1-W/index.html b/2.3/containers/CCTrie/Make/argument-1-W/index.html new file mode 100644 index 00000000..73237c7f --- /dev/null +++ b/2.3/containers/CCTrie/Make/argument-1-W/index.html @@ -0,0 +1,2 @@ + +1-W (containers.CCTrie.Make.1-W)

Parameter CCTrie.Make.1-W

type t
type char_
val compare : char_ ‑> char_ ‑> int
val to_seq : t ‑> char_ sequence
val of_list : char_ list ‑> t
\ No newline at end of file diff --git a/2.3/containers/CCTrie/Make/index.html b/2.3/containers/CCTrie/Make/index.html new file mode 100644 index 00000000..3a010d74 --- /dev/null +++ b/2.3/containers/CCTrie/Make/index.html @@ -0,0 +1,11 @@ + +Make (containers.CCTrie.Make)

Module CCTrie.Make

Parameters

Signature

type char_ = W.char_
type key = W.t
type 'a t
val empty : 'a t
val is_empty : _ t ‑> bool
val add : key ‑> 'a ‑> 'a t ‑> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key ‑> 'a t ‑> 'a t

Remove the key, if present.

val find : key ‑> 'a t ‑> 'a option

Find the value associated with the key, if any.

val find_exn : key ‑> 'a t ‑> 'a

Same as find but can fail.

  • Raises Not_found: if the key is not present.
val longest_prefix : key ‑> 'a t ‑> key

longest_prefix k m finds the longest prefix of k that leads to +at least one path in m (it does not mean that the prefix is bound to +a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m +will return "abc".

  • Since: 0.17
val update : key ‑> ('a option ‑> 'a option) ‑> 'a t ‑> 'a t

Update the binding for the given key. The function is given +None if the key is absent, or Some v if key is bound to v; +if it returns None the key is removed, otherwise it +returns Some y and key becomes bound to y.

val fold : ('b ‑> key ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

  • Since: 0.17
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving only the value.

  • Since: 0.17
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Same as fold, but for effectful functions.

val fold_values : ('b ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

More efficient version of fold, that doesn't keep keys.

val iter_values : ('a ‑> unit) ‑> 'a t ‑> unit
val merge : ('a ‑> 'a ‑> 'a option) ‑> 'a t ‑> 'a t ‑> 'a t

Merge two tries together. The function is used in +case of conflicts, when a key belongs to both tries.

val size : _ t ‑> int

Number of bindings.

Conversions
val to_list : 'a t ‑> (key * 'a) list
val of_list : (key * 'a) list ‑> 'a t
val to_seq : 'a t ‑> (key * 'a) sequence
val of_seq : (key * 'a) sequence ‑> 'a t
val to_seq_values : 'a t ‑> 'a sequence
val to_tree : 'a t ‑> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key ‑> 'a t ‑> (key * 'a) sequence

All bindings whose key is bigger or equal to the given key, in +ascending order.

val below : key ‑> 'a t ‑> (key * 'a) sequence

All bindings whose key is smaller or equal to the given key, +in decreasing order.

\ No newline at end of file diff --git a/2.3/containers/CCTrie/MakeArray/argument-1-X/index.html b/2.3/containers/CCTrie/MakeArray/argument-1-X/index.html new file mode 100644 index 00000000..f0bd1a35 --- /dev/null +++ b/2.3/containers/CCTrie/MakeArray/argument-1-X/index.html @@ -0,0 +1,2 @@ + +1-X (containers.CCTrie.MakeArray.1-X)

Parameter CCTrie.MakeArray.1-X

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCTrie/MakeArray/index.html b/2.3/containers/CCTrie/MakeArray/index.html new file mode 100644 index 00000000..2b7afb77 --- /dev/null +++ b/2.3/containers/CCTrie/MakeArray/index.html @@ -0,0 +1,11 @@ + +MakeArray (containers.CCTrie.MakeArray)

Module CCTrie.MakeArray

Parameters

Signature

type char_ = X.t
type key = X.t array
type 'a t
val empty : 'a t
val is_empty : _ t ‑> bool
val add : key ‑> 'a ‑> 'a t ‑> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key ‑> 'a t ‑> 'a t

Remove the key, if present.

val find : key ‑> 'a t ‑> 'a option

Find the value associated with the key, if any.

val find_exn : key ‑> 'a t ‑> 'a

Same as find but can fail.

  • Raises Not_found: if the key is not present.
val longest_prefix : key ‑> 'a t ‑> key

longest_prefix k m finds the longest prefix of k that leads to +at least one path in m (it does not mean that the prefix is bound to +a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m +will return "abc".

  • Since: 0.17
val update : key ‑> ('a option ‑> 'a option) ‑> 'a t ‑> 'a t

Update the binding for the given key. The function is given +None if the key is absent, or Some v if key is bound to v; +if it returns None the key is removed, otherwise it +returns Some y and key becomes bound to y.

val fold : ('b ‑> key ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

  • Since: 0.17
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving only the value.

  • Since: 0.17
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Same as fold, but for effectful functions.

val fold_values : ('b ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

More efficient version of fold, that doesn't keep keys.

val iter_values : ('a ‑> unit) ‑> 'a t ‑> unit
val merge : ('a ‑> 'a ‑> 'a option) ‑> 'a t ‑> 'a t ‑> 'a t

Merge two tries together. The function is used in +case of conflicts, when a key belongs to both tries.

val size : _ t ‑> int

Number of bindings.

Conversions
val to_list : 'a t ‑> (key * 'a) list
val of_list : (key * 'a) list ‑> 'a t
val to_seq : 'a t ‑> (key * 'a) sequence
val of_seq : (key * 'a) sequence ‑> 'a t
val to_seq_values : 'a t ‑> 'a sequence
val to_tree : 'a t ‑> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key ‑> 'a t ‑> (key * 'a) sequence

All bindings whose key is bigger or equal to the given key, in +ascending order.

val below : key ‑> 'a t ‑> (key * 'a) sequence

All bindings whose key is smaller or equal to the given key, +in decreasing order.

\ No newline at end of file diff --git a/2.3/containers/CCTrie/MakeList/argument-1-X/index.html b/2.3/containers/CCTrie/MakeList/argument-1-X/index.html new file mode 100644 index 00000000..3889db02 --- /dev/null +++ b/2.3/containers/CCTrie/MakeList/argument-1-X/index.html @@ -0,0 +1,2 @@ + +1-X (containers.CCTrie.MakeList.1-X)

Parameter CCTrie.MakeList.1-X

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCTrie/MakeList/index.html b/2.3/containers/CCTrie/MakeList/index.html new file mode 100644 index 00000000..a2632ff3 --- /dev/null +++ b/2.3/containers/CCTrie/MakeList/index.html @@ -0,0 +1,11 @@ + +MakeList (containers.CCTrie.MakeList)

Module CCTrie.MakeList

Parameters

Signature

type char_ = X.t
type key = X.t list
type 'a t
val empty : 'a t
val is_empty : _ t ‑> bool
val add : key ‑> 'a ‑> 'a t ‑> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key ‑> 'a t ‑> 'a t

Remove the key, if present.

val find : key ‑> 'a t ‑> 'a option

Find the value associated with the key, if any.

val find_exn : key ‑> 'a t ‑> 'a

Same as find but can fail.

  • Raises Not_found: if the key is not present.
val longest_prefix : key ‑> 'a t ‑> key

longest_prefix k m finds the longest prefix of k that leads to +at least one path in m (it does not mean that the prefix is bound to +a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m +will return "abc".

  • Since: 0.17
val update : key ‑> ('a option ‑> 'a option) ‑> 'a t ‑> 'a t

Update the binding for the given key. The function is given +None if the key is absent, or Some v if key is bound to v; +if it returns None the key is removed, otherwise it +returns Some y and key becomes bound to y.

val fold : ('b ‑> key ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

  • Since: 0.17
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving only the value.

  • Since: 0.17
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Same as fold, but for effectful functions.

val fold_values : ('b ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

More efficient version of fold, that doesn't keep keys.

val iter_values : ('a ‑> unit) ‑> 'a t ‑> unit
val merge : ('a ‑> 'a ‑> 'a option) ‑> 'a t ‑> 'a t ‑> 'a t

Merge two tries together. The function is used in +case of conflicts, when a key belongs to both tries.

val size : _ t ‑> int

Number of bindings.

Conversions
val to_list : 'a t ‑> (key * 'a) list
val of_list : (key * 'a) list ‑> 'a t
val to_seq : 'a t ‑> (key * 'a) sequence
val of_seq : (key * 'a) sequence ‑> 'a t
val to_seq_values : 'a t ‑> 'a sequence
val to_tree : 'a t ‑> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key ‑> 'a t ‑> (key * 'a) sequence

All bindings whose key is bigger or equal to the given key, in +ascending order.

val below : key ‑> 'a t ‑> (key * 'a) sequence

All bindings whose key is smaller or equal to the given key, +in decreasing order.

\ No newline at end of file diff --git a/2.3/containers/CCTrie/String/index.html b/2.3/containers/CCTrie/String/index.html new file mode 100644 index 00000000..da0f0fb0 --- /dev/null +++ b/2.3/containers/CCTrie/String/index.html @@ -0,0 +1,11 @@ + +String (containers.CCTrie.String)

Module CCTrie.String

type char_ = char
type key = string
type 'a t
val empty : 'a t
val is_empty : _ t ‑> bool
val add : key ‑> 'a ‑> 'a t ‑> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key ‑> 'a t ‑> 'a t

Remove the key, if present.

val find : key ‑> 'a t ‑> 'a option

Find the value associated with the key, if any.

val find_exn : key ‑> 'a t ‑> 'a

Same as find but can fail.

  • Raises Not_found: if the key is not present.
val longest_prefix : key ‑> 'a t ‑> key

longest_prefix k m finds the longest prefix of k that leads to +at least one path in m (it does not mean that the prefix is bound to +a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m +will return "abc".

  • Since: 0.17
val update : key ‑> ('a option ‑> 'a option) ‑> 'a t ‑> 'a t

Update the binding for the given key. The function is given +None if the key is absent, or Some v if key is bound to v; +if it returns None the key is removed, otherwise it +returns Some y and key becomes bound to y.

val fold : ('b ‑> key ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

  • Since: 0.17
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving only the value.

  • Since: 0.17
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Same as fold, but for effectful functions.

val fold_values : ('b ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

More efficient version of fold, that doesn't keep keys.

val iter_values : ('a ‑> unit) ‑> 'a t ‑> unit
val merge : ('a ‑> 'a ‑> 'a option) ‑> 'a t ‑> 'a t ‑> 'a t

Merge two tries together. The function is used in +case of conflicts, when a key belongs to both tries.

val size : _ t ‑> int

Number of bindings.

Conversions
val to_list : 'a t ‑> (key * 'a) list
val of_list : (key * 'a) list ‑> 'a t
val to_seq : 'a t ‑> (key * 'a) sequence
val of_seq : (key * 'a) sequence ‑> 'a t
val to_seq_values : 'a t ‑> 'a sequence
val to_tree : 'a t ‑> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key ‑> 'a t ‑> (key * 'a) sequence

All bindings whose key is bigger or equal to the given key, in +ascending order.

val below : key ‑> 'a t ‑> (key * 'a) sequence

All bindings whose key is smaller or equal to the given key, +in decreasing order.

\ No newline at end of file diff --git a/2.3/containers/CCTrie/index.html b/2.3/containers/CCTrie/index.html new file mode 100644 index 00000000..24d35c72 --- /dev/null +++ b/2.3/containers/CCTrie/index.html @@ -0,0 +1,2 @@ + +CCTrie (containers.CCTrie)

Module CCTrie

Prefix Tree

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a ktree = unit ‑> [ `Nil | `Node of 'a * 'a ktree list ]

Signatures

A Composite Word

Words are made of characters, who belong to a total order

module type WORD : sig ... end
module type S : sig ... end

Implementation

module Make : functor (W : WORD) -> S with type key = W.t and type char_ = W.char_
module type ORDERED : sig ... end
module MakeArray : functor (X : ORDERED) -> S with type key = X.t array and type char_ = X.t
module MakeList : functor (X : ORDERED) -> S with type key = X.t list and type char_ = X.t
module String : S with type key = string and type char_ = char
\ No newline at end of file diff --git a/2.3/containers/CCTrie/module-type-ORDERED/index.html b/2.3/containers/CCTrie/module-type-ORDERED/index.html new file mode 100644 index 00000000..a3632bf0 --- /dev/null +++ b/2.3/containers/CCTrie/module-type-ORDERED/index.html @@ -0,0 +1,2 @@ + +ORDERED (containers.CCTrie.ORDERED)

Module type CCTrie.ORDERED

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCTrie/module-type-S/index.html b/2.3/containers/CCTrie/module-type-S/index.html new file mode 100644 index 00000000..f6306a7f --- /dev/null +++ b/2.3/containers/CCTrie/module-type-S/index.html @@ -0,0 +1,11 @@ + +S (containers.CCTrie.S)

Module type CCTrie.S

type char_
type key
type 'a t
val empty : 'a t
val is_empty : _ t ‑> bool
val add : key ‑> 'a ‑> 'a t ‑> 'a t

Add a binding to the trie (possibly erasing the previous one).

val remove : key ‑> 'a t ‑> 'a t

Remove the key, if present.

val find : key ‑> 'a t ‑> 'a option

Find the value associated with the key, if any.

val find_exn : key ‑> 'a t ‑> 'a

Same as find but can fail.

  • Raises Not_found: if the key is not present.
val longest_prefix : key ‑> 'a t ‑> key

longest_prefix k m finds the longest prefix of k that leads to +at least one path in m (it does not mean that the prefix is bound to +a value.

Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m +will return "abc".

  • Since: 0.17
val update : key ‑> ('a option ‑> 'a option) ‑> 'a t ‑> 'a t

Update the binding for the given key. The function is given +None if the key is absent, or Some v if key is bound to v; +if it returns None the key is removed, otherwise it +returns Some y and key becomes bound to y.

val fold : ('b ‑> key ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

Fold on key/value bindings. Will use WORD.of_list to rebuild keys.

val mapi : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

  • Since: 0.17
val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving only the value.

  • Since: 0.17
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Same as fold, but for effectful functions.

val fold_values : ('b ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

More efficient version of fold, that doesn't keep keys.

val iter_values : ('a ‑> unit) ‑> 'a t ‑> unit
val merge : ('a ‑> 'a ‑> 'a option) ‑> 'a t ‑> 'a t ‑> 'a t

Merge two tries together. The function is used in +case of conflicts, when a key belongs to both tries.

val size : _ t ‑> int

Number of bindings.

Conversions
val to_list : 'a t ‑> (key * 'a) list
val of_list : (key * 'a) list ‑> 'a t
val to_seq : 'a t ‑> (key * 'a) sequence
val of_seq : (key * 'a) sequence ‑> 'a t
val to_seq_values : 'a t ‑> 'a sequence
val to_tree : 'a t ‑> [ `Char of char_ | `Val of 'a | `Switch ] ktree
Ranges
val above : key ‑> 'a t ‑> (key * 'a) sequence

All bindings whose key is bigger or equal to the given key, in +ascending order.

val below : key ‑> 'a t ‑> (key * 'a) sequence

All bindings whose key is smaller or equal to the given key, +in decreasing order.

\ No newline at end of file diff --git a/2.3/containers/CCTrie/module-type-WORD/index.html b/2.3/containers/CCTrie/module-type-WORD/index.html new file mode 100644 index 00000000..1248a793 --- /dev/null +++ b/2.3/containers/CCTrie/module-type-WORD/index.html @@ -0,0 +1,2 @@ + +WORD (containers.CCTrie.WORD)

Module type CCTrie.WORD

type t
type char_
val compare : char_ ‑> char_ ‑> int
val to_seq : t ‑> char_ sequence
val of_list : char_ list ‑> t
\ No newline at end of file diff --git a/2.3/containers/CCUnix/.jbuilder-keep b/2.3/containers/CCUnix/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCUnix/Infix/index.html b/2.3/containers/CCUnix/Infix/index.html new file mode 100644 index 00000000..d19ff168 --- /dev/null +++ b/2.3/containers/CCUnix/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCUnix.Infix)

Module CCUnix.Infix

val (?|) : ('a, Buffer.t, unit, call_result) Pervasives.format4 ‑> 'a

Infix version of call.

  • Since: 0.11
val (?|&) : ('a, Buffer.t, unit, async_call_result) Pervasives.format4 ‑> 'a

Infix version of async_call.

  • Since: 0.11
\ No newline at end of file diff --git a/2.3/containers/CCUnix/index.html b/2.3/containers/CCUnix/index.html new file mode 100644 index 00000000..8c3725cb --- /dev/null +++ b/2.3/containers/CCUnix/index.html @@ -0,0 +1,18 @@ + +CCUnix (containers.CCUnix)

Module CCUnix

High-level Functions on top of Unix

Some useful functions built on top of Unix.

status: unstable

type 'a or_error = ('a, string) Result.result
type 'a gen = unit ‑> 'a option

Calling Commands

val escape_str : string ‑> string

Escape a string so it can be a shell argument.

type call_result = < stdout : string; stderr : string; status : Unix.process_status; errcode : int; >
val call_full : ?⁠bufsize:int ‑> ?⁠stdin:[ `Gen of string gen | `Str of string ] ‑> ?⁠env:string array ‑> ('a, Buffer.t, unit, call_result) Pervasives.format4 ‑> 'a

call_full cmd wraps the result of Unix.open_process_full cmd into an +object. It reads the full stdout and stderr of the subprocess before +returning.

  • Parameter stdin: if provided, the generator or string is consumed and fed to +the subprocess input channel, which is then closed.
  • Parameter bufsize: buffer size used to read stdout and stderr.
  • Parameter env: environment to run the command in.
val call : ?⁠bufsize:int ‑> ?⁠stdin:[ `Gen of string gen | `Str of string ] ‑> ?⁠env:string array ‑> ('a, Buffer.t, unit, string * string * int) Pervasives.format4 ‑> 'a

call cmd is similar to call_full cmd but returns +a tuple stdout, stderr, errcode instead of an object.

val call_stdout : ?⁠bufsize:int ‑> ?⁠stdin:[ `Gen of string gen | `Str of string ] ‑> ?⁠env:string array ‑> ('a, Buffer.t, unit, string) Pervasives.format4 ‑> 'a
type line = string
type async_call_result = < stdout : line gen; stderr : line gen; stdin : line ‑> unit; close_in : unit; close_err : unit; close_out : unit; close_all : unit; wait : Unix.process_status; wait_errcode : int; >

A subprocess for interactive usage (read/write channels line by line)

  • Since: 0.11
val async_call : ?⁠env:string array ‑> ('a, Buffer.t, unit, async_call_result) Pervasives.format4 ‑> 'a

Spawns a subprocess, like call, but the subprocess's channels are +line generators and line sinks (for stdin). +If p is async_call "cmd", then p#wait waits for the subprocess +to die. Channels can be closed independently.

  • Since: 0.11

Accessors

val stdout : < stdout : 'a; .. > ‑> 'a
val stderr : < stderr : 'a; .. > ‑> 'a
val status : < status : 'a; .. > ‑> 'a
val errcode : < errcode : 'a; .. > ‑> 'a

Simple IO

val with_in : ?⁠mode:int ‑> ?⁠flags:Unix.open_flag list ‑> string ‑> f:(Pervasives.in_channel ‑> 'a) ‑> 'a

Open an input file with the given optional flag list, calls the function +on the input channel. When the function raises or returns, the +channel is closed.

  • Parameter flags: opening flags. Unix.O_RDONLY is used in any cases.
  • Since: 0.16
val with_out : ?⁠mode:int ‑> ?⁠flags:Unix.open_flag list ‑> string ‑> f:(Pervasives.out_channel ‑> 'a) ‑> 'a

Same as with_in but for an output channel.

  • Parameter flags: opening flags (default [Unix.O_CREAT; Unix.O_TRUNC]) +Unix.O_WRONLY is used in any cases.
  • Since: 0.16
val with_process_in : string ‑> f:(Pervasives.in_channel ‑> 'a) ‑> 'a

Open a subprocess and obtain a handle to its stdout. +

      CCUnix.with_process_in "ls /tmp" ~f:CCIO.read_lines_l;;
  • Since: 0.16
val with_process_out : string ‑> f:(Pervasives.out_channel ‑> 'a) ‑> 'a

Open a subprocess and obtain a handle to its stdin.

  • Since: 0.16
type process_full = < stdin : Pervasives.out_channel; stdout : Pervasives.in_channel; stderr : Pervasives.in_channel; close : Unix.process_status; >

Handle to a subprocess.

  • Since: 0.16
val with_process_full : ?⁠env:string array ‑> string ‑> f:(process_full ‑> 'a) ‑> 'a

Open a subprocess and obtain a handle to its channels.

  • Parameter env: environment to pass to the subprocess.
  • Since: 0.16
val with_connection : Unix.sockaddr ‑> f:(Pervasives.in_channel ‑> Pervasives.out_channel ‑> 'a) ‑> 'a

Wrap Unix.open_connection with a handler.

  • Since: 0.16
exception ExitServer
val establish_server : Unix.sockaddr ‑> f:(Pervasives.in_channel ‑> Pervasives.out_channel ‑> _) ‑> unit

Listen on the address and calls the handler in a blocking fashion. +Using Thread is recommended if handlers might take time. +The callback should raise ExitServer to stop the loop.

  • Since: 0.16
val with_file_lock : kind:[ `Read | `Write ] ‑> string ‑> (unit ‑> 'a) ‑> 'a

with_file_lock ~kind filename f puts a lock on the offset 0 +of the file named filename, calls f and returns its result after +the file is unlocked. If f () raises an exception the exception is +re-raised after the file is unlocked.

  • Parameter kind: specifies whether the lock is read-only or read-write.
  • Since: 1.2

Infix Functions

module Infix : sig ... end
include module type of Infix
val (?|) : ('a, Buffer.t, unit, call_result) Pervasives.format4 ‑> 'a

Infix version of call.

  • Since: 0.11
val (?|&) : ('a, Buffer.t, unit, async_call_result) Pervasives.format4 ‑> 'a

Infix version of async_call.

  • Since: 0.11
\ No newline at end of file diff --git a/2.3/containers/CCUtf8_string/.jbuilder-keep b/2.3/containers/CCUtf8_string/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCUtf8_string/index.html b/2.3/containers/CCUtf8_string/index.html new file mode 100644 index 00000000..c11fe15e --- /dev/null +++ b/2.3/containers/CCUtf8_string/index.html @@ -0,0 +1,8 @@ + +CCUtf8_string (containers.CCUtf8_string)

Module CCUtf8_string

Unicode String, in UTF8

A unicode string represented by a utf8 bytestring. This representation +is convenient for manipulating normal OCaml strings that are encoded +in UTF8.

We perform only basic decoding and encoding between codepoints and +bytestrings. +For more elaborate operations, +please use the excellent Uutf.

status: experimental

type uchar = Uchar.t
type 'a gen = unit ‑> 'a option
type 'a sequence = ('a ‑> unit) ‑> unit
type t = private string

A UTF8 string

val equal : t ‑> t ‑> bool
val hash : t ‑> int
val compare : t ‑> t ‑> int
val pp : Format.formatter ‑> t ‑> unit
val to_string : t ‑> string

Identity.

exception Malformed of string * int

Malformed string at given offset

val to_gen : ?⁠idx:int ‑> t ‑> uchar gen

Generator of unicode codepoints.

  • Parameter idx: offset where to start the decoding.
val to_seq : ?⁠idx:int ‑> t ‑> uchar sequence

Sequence of unicode codepoints.

  • Parameter idx: offset where to start the decoding.
val to_list : ?⁠idx:int ‑> t ‑> uchar list

List of unicode codepoints.

  • Parameter idx: offset where to start the decoding.
val fold : ?⁠idx:int ‑> ('a ‑> uchar ‑> 'a) ‑> 'a ‑> t ‑> 'a
val iter : ?⁠idx:int ‑> (uchar ‑> unit) ‑> t ‑> unit
val n_chars : t ‑> int

Number of characters.

val n_bytes : t ‑> int

Number of bytes.

val map : (uchar ‑> uchar) ‑> t ‑> t
val filter_map : (uchar ‑> uchar option) ‑> t ‑> t
val flat_map : (uchar ‑> t) ‑> t ‑> t
val append : t ‑> t ‑> t
val concat : t ‑> t list ‑> t
val of_seq : uchar sequence ‑> t
val of_gen : uchar gen ‑> t
val of_list : uchar list ‑> t
val of_string_exn : string ‑> t

Validate string by checking it is valid UTF8.

  • Raises Invalid_argument: if the string is not valid UTF8.
val of_string : string ‑> t option

Safe version of of_string_exn.

val is_valid : string ‑> bool

Valid UTF8?

val unsafe_of_string : string ‑> t

Conversion from a string without validating. +Upon iteration, if an invalid substring is met, Malformed will be raised.

\ No newline at end of file diff --git a/2.3/containers/CCVector/.jbuilder-keep b/2.3/containers/CCVector/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCVector/index.html b/2.3/containers/CCVector/index.html new file mode 100644 index 00000000..b3702043 --- /dev/null +++ b/2.3/containers/CCVector/index.html @@ -0,0 +1,23 @@ + +CCVector (containers.CCVector)

Module CCVector

Growable, mutable vector

type ro = [
| `RO
]
type rw = [
| `RW
]

Mutability is rw (read-write) or ro (read-only).

type ('a, 'mut) t

The type of a vector of elements of type 'a, with +a mutability flat 'mut.

type 'a vector = ('arwt

Type synonym: a 'a vector is mutable.

type 'a ro_vector = ('arot

Alias for immutable vectors.

  • Since: 0.15
type 'a sequence = ('a ‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a gen = unit ‑> 'a option
type 'a equal = 'a ‑> 'a ‑> bool
type 'a ord = 'a ‑> 'a ‑> int
type 'a printer = Format.formatter ‑> 'a ‑> unit
val freeze : ('a_t ‑> ('arot

Make an immutable vector (no copy! Don't use the old version).

val freeze_copy : ('a_t ‑> ('arot

Copy the vector into an immutable version.

val create : unit ‑> ('arwt

Create a new, empty vector.

val create_with : ?⁠capacity:int ‑> 'a ‑> ('arwt

Create a new vector, using the given value as a filler.

  • Parameter capacity: the size of the underlying array. +caution: the value will likely not be GC'd before the vector is.
val return : 'a ‑> ('a'mutt

Singleton vector.

  • Since: 0.14
val make : int ‑> 'a ‑> ('a'mutt

make n x makes a vector of size n, filled with x.

val init : int ‑> (int ‑> 'a) ‑> ('a'mutt

Init the vector with the given function and size.

val clear : ('arwt ‑> unit

Clear the content of the vector.

val ensure_with : init:'a ‑> ('arwt ‑> int ‑> unit

Hint to the vector that it should have at least the given capacity.

  • Parameter init: if capacity v = 0, used as a filler +element for the underlying array (see create_with).
  • Since: 0.14
val ensure : ('arwt ‑> int ‑> unit

Hint to the vector that it should have at least the given capacity. +Just a hint, will not be enforced if the vector is empty and init +is not provided.

val is_empty : ('a_t ‑> bool

Is the vector empty?

val push : ('arwt ‑> 'a ‑> unit

Add an element at the end of the vector.

val append : ('arwt ‑> ('a_t ‑> unit

append a b adds all elements of b to a.

val append_array : ('arwt ‑> 'a array ‑> unit

Like append, with an array.

val append_seq : ('arwt ‑> 'a sequence ‑> unit

Append content of sequence.

val append_list : ('arwt ‑> 'a list ‑> unit

Append content of list.

  • Since: 0.14
val append_gen : ('arwt ‑> 'a gen ‑> unit

Append content of generator.

  • Since: 0.20
val equal : 'a equal ‑> ('a_t equal
val compare : 'a ord ‑> ('a_t ord

Total ordering on vectors. Lexicographic comparison.

exception Empty

Raised on empty stack.

val pop : ('arwt ‑> 'a option

Remove last element, or None.

val pop_exn : ('arwt ‑> 'a

Remove last element, or raise a Failure if empty.

  • Raises Empty: on an empty vector.
val top : ('a_t ‑> 'a option

Top element, if present.

  • Since: 0.6
val top_exn : ('a_t ‑> 'a

Top element, if present.

  • Raises Empty: on an empty vector.
  • Since: 0.6
val copy : ('a_t ‑> ('a'mutt

Shallow copy (may give an immutable or mutable vector).

val shrink : ('arwt ‑> int ‑> unit

Shrink to the given size (remove elements above this size). +Does nothing if the parameter is bigger than the current size.

val member : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a_t ‑> bool

Is the element a member of the vector?

val sort : ('a ‑> 'a ‑> int) ‑> ('a_t ‑> ('a'mutt

Sort the vector, returning a copy of it that is sorted +w.r.t the given ordering. The vector itself is unchanged.

val sort' : ('a ‑> 'a ‑> int) ‑> ('arwt ‑> unit

Sort the vector in place (modifying it).

val uniq_sort : ('a ‑> 'a ‑> int) ‑> ('arwt ‑> unit

Sort the array and remove duplicates, in place (e.g. modifying +the vector itself).

val iter : ('a ‑> unit) ‑> ('a_t ‑> unit

Iterate on the vector's content.

val iteri : (int ‑> 'a ‑> unit) ‑> ('a_t ‑> unit

Iterate on the vector, with indexes.

val map : ('a ‑> 'b) ‑> ('a_t ‑> ('b'mutt

Map elements of the vector, yielding a new vector.

val map_in_place : ('a ‑> 'a) ‑> ('a_t ‑> unit

Map elements of the vector in place

  • Since: 2.3
val filter : ('a ‑> bool) ‑> ('a_t ‑> ('a'mutt

Filter elements from the vector. filter p v leaves v unchanged but +returns a new vector that only contains elements of v satisfying p.

val filter' : ('a ‑> bool) ‑> ('arwt ‑> unit

Filter elements in place.

val fold : ('b ‑> 'a ‑> 'b) ‑> 'b ‑> ('a_t ‑> 'b

Fold on elements of the vector

val exists : ('a ‑> bool) ‑> ('a_t ‑> bool

Existential test (is there an element that satisfies the predicate?).

val for_all : ('a ‑> bool) ‑> ('a_t ‑> bool

Universal test (do all the elements satisfy the predicate?).

val find : ('a ‑> bool) ‑> ('a_t ‑> 'a option

Find an element that satisfies the predicate.

val find_exn : ('a ‑> bool) ‑> ('a_t ‑> 'a

Find an element that satisfies the predicate, or

  • Raises Not_found: if no element does.
val find_map : ('a ‑> 'b option) ‑> ('a_t ‑> 'b option

find_map f v returns the first Some y = f x for x in v, +or None if f x = None for each x in v.

  • Since: 0.14
val filter_map : ('a ‑> 'b option) ‑> ('a_t ‑> ('b'mutt

Map elements with a function, possibly filtering some of them out.

val filter_map_in_place : ('a ‑> 'a option) ‑> ('a_t ‑> unit

Filter-map elements of the vector in place

  • Since: 2.3
val flat_map : ('a ‑> ('b_t) ‑> ('a_t ‑> ('b'mutt

Map each element to a sub-vector.

val flat_map_seq : ('a ‑> 'b sequence) ‑> ('a_t ‑> ('b'mutt

Like flat_map, but using sequence for +intermediate collections.

  • Since: 0.14
val flat_map_list : ('a ‑> 'b list) ‑> ('a_t ‑> ('b'mutt

Like flat_map, but using list for +intermediate collections.

  • Since: 0.14
val (>>=) : ('a_t ‑> ('a ‑> ('b_t) ‑> ('b'mutt

Infix version of flat_map.

val (>|=) : ('a_t ‑> ('a ‑> 'b) ‑> ('b'mutt

Infix version of map.

val get : ('a_t ‑> int ‑> 'a

Access element by its index, or

  • Raises Invalid_argument: if bad index.
val set : ('arwt ‑> int ‑> 'a ‑> unit

Modify element at given index, or

  • Raises Invalid_argument: if bad index.
val remove : ('arwt ‑> int ‑> unit

Remove the n-th element of the vector. Does NOT preserve the order +of the elements (might swap with the last element).

val rev : ('a_t ‑> ('a'mutt

Reverse the vector.

val rev_in_place : ('arwt ‑> unit

Reverse the vector in place.

  • Since: 0.14
val rev_iter : ('a ‑> unit) ‑> ('a_t ‑> unit

rev_iter f a is the same as iter f (rev a), only more efficient.

  • Since: 0.14
val size : ('a_t ‑> int

Number of elements in the vector.

val length : (__t ‑> int

Synonym for size.

val capacity : (__t ‑> int

Number of elements the vector can contain without being resized.

val unsafe_get_array : ('arwt ‑> 'a array

Access the underlying shared array (do not modify!). +unsafe_get_array v is longer than size v, but elements at higher +index than size v are undefined (do not access!).

val (--) : int ‑> int ‑> (int, 'mutt

Range of integers, either ascending or descending (both included, +therefore the result is never empty). +Example: 1 -- 10 returns the vector [1;2;3;4;5;6;7;8;9;10].

val (--^) : int ‑> int ‑> (int, 'mutt

Range of integers, either ascending or descending, but excluding right. +Example: 1 --^ 10 returns the vector [1;2;3;4;5;6;7;8;9].

  • Since: 0.17
val of_array : 'a array ‑> ('a'mutt

of_array a returns a vector corresponding to the array a. Operates in O(n) time.

val of_list : 'a list ‑> ('a'mutt
val to_array : ('a_t ‑> 'a array

to_array v returns an array corresponding to the vector v.

val to_list : ('a_t ‑> 'a list

Return a list with the elements contained in the vector.

val of_seq : ?⁠init:('arwt ‑> 'a sequence ‑> ('arwt
val to_seq : ('a_t ‑> 'a sequence

Return a sequence with the elements contained in the vector.

val to_seq_rev : ('a_t ‑> 'a sequence

to_seq_rev v returns the sequence of elements of v in reverse order, +that is, the last elements of v are iterated on first.

  • Since: 0.14
val slice : ('arwt ‑> 'a array * int * int

Vector as an array slice. By doing it we expose the internal array, so +be careful!.

val slice_seq : ('a_t ‑> int ‑> int ‑> 'a sequence

slice_seq v start len is the sequence of elements from v.(start) +to v.(start+len-1).

val of_klist : ?⁠init:('arwt ‑> 'a klist ‑> ('arwt
val to_klist : ('a_t ‑> 'a klist
val of_gen : ?⁠init:('arwt ‑> 'a gen ‑> ('arwt
val to_gen : ('a_t ‑> 'a gen
val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a printer ‑> ('a_t printer
\ No newline at end of file diff --git a/2.3/containers/CCWBTree/.jbuilder-keep b/2.3/containers/CCWBTree/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCWBTree/Make/argument-1-X/index.html b/2.3/containers/CCWBTree/Make/argument-1-X/index.html new file mode 100644 index 00000000..b0e4f9af --- /dev/null +++ b/2.3/containers/CCWBTree/Make/argument-1-X/index.html @@ -0,0 +1,2 @@ + +1-X (containers.CCWBTree.Make.1-X)

Parameter CCWBTree.Make.1-X

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCWBTree/Make/index.html b/2.3/containers/CCWBTree/Make/index.html new file mode 100644 index 00000000..c1eb852a --- /dev/null +++ b/2.3/containers/CCWBTree/Make/index.html @@ -0,0 +1,12 @@ + +Make (containers.CCWBTree.Make)

Module CCWBTree.Make

Parameters

X : ORD

Signature

type key = X.t
type +'a t
val empty : 'a t
val is_empty : _ t ‑> bool
val singleton : key ‑> 'a ‑> 'a t
val mem : key ‑> _ t ‑> bool
val get : key ‑> 'a t ‑> 'a option
val get_exn : key ‑> 'a t ‑> 'a
  • Raises Not_found: if the key is not present.
val nth : int ‑> 'a t ‑> (key * 'a) option

nth i m returns the i-th key, value in the ascending +order. Complexity is O(log (cardinal m)).

val nth_exn : int ‑> 'a t ‑> key * 'a
  • Raises Not_found: if the index is invalid.
val get_rank : key ‑> 'a t ‑> [ `At of int | `After of int | `First ]

get_rank k m looks for the rank of k in m, i.e. the index +of k in the sorted list of bindings of m. +let (`At n) = get_rank k m in nth_exn n m = get m k should hold.

  • Since: 1.4
val add : key ‑> 'a ‑> 'a t ‑> 'a t
val remove : key ‑> 'a t ‑> 'a t
val update : key ‑> ('a option ‑> 'a option) ‑> 'a t ‑> 'a t

update k f m calls f (Some v) if get k m = Some v, f None +otherwise. Then, if f returns Some v' it binds k to v', +if f returns None it removes k.

val cardinal : _ t ‑> int
val weight : _ t ‑> int
val fold : f:('b ‑> key ‑> 'a ‑> 'b) ‑> x:'b ‑> 'a t ‑> 'b
val mapi : f:(key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

  • Since: 0.17
val map : f:('a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving only the value.

  • Since: 0.17
val iter : f:(key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val split : key ‑> 'a t ‑> 'a t * 'a option * 'a t

split k t returns l, o, r where l is the part of the map +with keys smaller than k, r has keys bigger than k, +and o = Some v if k, v belonged to the map.

val merge : f:(key ‑> 'a option ‑> 'b option ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

Like Map.S.merge.

val extract_min : 'a t ‑> key * 'a * 'a t

extract_min m returns k, v, m' where k,v is the pair with the +smallest key in m, and m' does not contain k.

  • Raises Not_found: if the map is empty.
val extract_max : 'a t ‑> key * 'a * 'a t

extract_max m returns k, v, m' where k,v is the pair with the +highest key in m, and m' does not contain k.

  • Raises Not_found: if the map is empty.
val choose : 'a t ‑> (key * 'a) option
val choose_exn : 'a t ‑> key * 'a
  • Raises Not_found: if the tree is empty.
val random_choose : Random.State.t ‑> 'a t ‑> key * 'a

Randomly choose a (key,value) pair within the tree, using weights +as probability weights.

  • Raises Not_found: if the tree is empty.
val add_list : 'a t ‑> (key * 'a) list ‑> 'a t
val of_list : (key * 'a) list ‑> 'a t
val to_list : 'a t ‑> (key * 'a) list
val add_seq : 'a t ‑> (key * 'a) sequence ‑> 'a t
val of_seq : (key * 'a) sequence ‑> 'a t
val to_seq : 'a t ‑> (key * 'a) sequence
val add_gen : 'a t ‑> (key * 'a) gen ‑> 'a t
val of_gen : (key * 'a) gen ‑> 'a t
val to_gen : 'a t ‑> (key * 'a) gen
val pp : key printer ‑> 'a printer ‑> 'a t printer

Renamed from val print.

  • Since: 2.0
\ No newline at end of file diff --git a/2.3/containers/CCWBTree/MakeFull/argument-1-X/index.html b/2.3/containers/CCWBTree/MakeFull/argument-1-X/index.html new file mode 100644 index 00000000..cdda038b --- /dev/null +++ b/2.3/containers/CCWBTree/MakeFull/argument-1-X/index.html @@ -0,0 +1,2 @@ + +1-X (containers.CCWBTree.MakeFull.1-X)

Parameter CCWBTree.MakeFull.1-X

include ORD
type t
val compare : t ‑> t ‑> int
val weight : t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCWBTree/MakeFull/index.html b/2.3/containers/CCWBTree/MakeFull/index.html new file mode 100644 index 00000000..13e49706 --- /dev/null +++ b/2.3/containers/CCWBTree/MakeFull/index.html @@ -0,0 +1,12 @@ + +MakeFull (containers.CCWBTree.MakeFull)

Module CCWBTree.MakeFull

Use the custom X.weight function

Parameters

X : KEY

Signature

type key = X.t
type +'a t
val empty : 'a t
val is_empty : _ t ‑> bool
val singleton : key ‑> 'a ‑> 'a t
val mem : key ‑> _ t ‑> bool
val get : key ‑> 'a t ‑> 'a option
val get_exn : key ‑> 'a t ‑> 'a
  • Raises Not_found: if the key is not present.
val nth : int ‑> 'a t ‑> (key * 'a) option

nth i m returns the i-th key, value in the ascending +order. Complexity is O(log (cardinal m)).

val nth_exn : int ‑> 'a t ‑> key * 'a
  • Raises Not_found: if the index is invalid.
val get_rank : key ‑> 'a t ‑> [ `At of int | `After of int | `First ]

get_rank k m looks for the rank of k in m, i.e. the index +of k in the sorted list of bindings of m. +let (`At n) = get_rank k m in nth_exn n m = get m k should hold.

  • Since: 1.4
val add : key ‑> 'a ‑> 'a t ‑> 'a t
val remove : key ‑> 'a t ‑> 'a t
val update : key ‑> ('a option ‑> 'a option) ‑> 'a t ‑> 'a t

update k f m calls f (Some v) if get k m = Some v, f None +otherwise. Then, if f returns Some v' it binds k to v', +if f returns None it removes k.

val cardinal : _ t ‑> int
val weight : _ t ‑> int
val fold : f:('b ‑> key ‑> 'a ‑> 'b) ‑> x:'b ‑> 'a t ‑> 'b
val mapi : f:(key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

  • Since: 0.17
val map : f:('a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving only the value.

  • Since: 0.17
val iter : f:(key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val split : key ‑> 'a t ‑> 'a t * 'a option * 'a t

split k t returns l, o, r where l is the part of the map +with keys smaller than k, r has keys bigger than k, +and o = Some v if k, v belonged to the map.

val merge : f:(key ‑> 'a option ‑> 'b option ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

Like Map.S.merge.

val extract_min : 'a t ‑> key * 'a * 'a t

extract_min m returns k, v, m' where k,v is the pair with the +smallest key in m, and m' does not contain k.

  • Raises Not_found: if the map is empty.
val extract_max : 'a t ‑> key * 'a * 'a t

extract_max m returns k, v, m' where k,v is the pair with the +highest key in m, and m' does not contain k.

  • Raises Not_found: if the map is empty.
val choose : 'a t ‑> (key * 'a) option
val choose_exn : 'a t ‑> key * 'a
  • Raises Not_found: if the tree is empty.
val random_choose : Random.State.t ‑> 'a t ‑> key * 'a

Randomly choose a (key,value) pair within the tree, using weights +as probability weights.

  • Raises Not_found: if the tree is empty.
val add_list : 'a t ‑> (key * 'a) list ‑> 'a t
val of_list : (key * 'a) list ‑> 'a t
val to_list : 'a t ‑> (key * 'a) list
val add_seq : 'a t ‑> (key * 'a) sequence ‑> 'a t
val of_seq : (key * 'a) sequence ‑> 'a t
val to_seq : 'a t ‑> (key * 'a) sequence
val add_gen : 'a t ‑> (key * 'a) gen ‑> 'a t
val of_gen : (key * 'a) gen ‑> 'a t
val to_gen : 'a t ‑> (key * 'a) gen
val pp : key printer ‑> 'a printer ‑> 'a t printer

Renamed from val print.

  • Since: 2.0
\ No newline at end of file diff --git a/2.3/containers/CCWBTree/index.html b/2.3/containers/CCWBTree/index.html new file mode 100644 index 00000000..f2f0c20e --- /dev/null +++ b/2.3/containers/CCWBTree/index.html @@ -0,0 +1,2 @@ + +CCWBTree (containers.CCWBTree)

Module CCWBTree

Weight-Balanced Tree

status: experimental

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
type 'a printer = Format.formatter ‑> 'a ‑> unit
module type ORD : sig ... end
module type KEY : sig ... end

Signature

module type S : sig ... end

Functor

module Make : functor (X : ORD) -> S with type key = X.t
module MakeFull : functor (X : KEY) -> S with type key = X.t

Use the custom X.weight function

\ No newline at end of file diff --git a/2.3/containers/CCWBTree/module-type-KEY/index.html b/2.3/containers/CCWBTree/module-type-KEY/index.html new file mode 100644 index 00000000..c1a12a93 --- /dev/null +++ b/2.3/containers/CCWBTree/module-type-KEY/index.html @@ -0,0 +1,2 @@ + +KEY (containers.CCWBTree.KEY)

Module type CCWBTree.KEY

include ORD
type t
val compare : t ‑> t ‑> int
val weight : t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCWBTree/module-type-ORD/index.html b/2.3/containers/CCWBTree/module-type-ORD/index.html new file mode 100644 index 00000000..b20eedc5 --- /dev/null +++ b/2.3/containers/CCWBTree/module-type-ORD/index.html @@ -0,0 +1,2 @@ + +ORD (containers.CCWBTree.ORD)

Module type CCWBTree.ORD

type t
val compare : t ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/CCWBTree/module-type-S/index.html b/2.3/containers/CCWBTree/module-type-S/index.html new file mode 100644 index 00000000..d7176033 --- /dev/null +++ b/2.3/containers/CCWBTree/module-type-S/index.html @@ -0,0 +1,12 @@ + +S (containers.CCWBTree.S)

Module type CCWBTree.S

type key
type +'a t
val empty : 'a t
val is_empty : _ t ‑> bool
val singleton : key ‑> 'a ‑> 'a t
val mem : key ‑> _ t ‑> bool
val get : key ‑> 'a t ‑> 'a option
val get_exn : key ‑> 'a t ‑> 'a
  • Raises Not_found: if the key is not present.
val nth : int ‑> 'a t ‑> (key * 'a) option

nth i m returns the i-th key, value in the ascending +order. Complexity is O(log (cardinal m)).

val nth_exn : int ‑> 'a t ‑> key * 'a
  • Raises Not_found: if the index is invalid.
val get_rank : key ‑> 'a t ‑> [ `At of int | `After of int | `First ]

get_rank k m looks for the rank of k in m, i.e. the index +of k in the sorted list of bindings of m. +let (`At n) = get_rank k m in nth_exn n m = get m k should hold.

  • Since: 1.4
val add : key ‑> 'a ‑> 'a t ‑> 'a t
val remove : key ‑> 'a t ‑> 'a t
val update : key ‑> ('a option ‑> 'a option) ‑> 'a t ‑> 'a t

update k f m calls f (Some v) if get k m = Some v, f None +otherwise. Then, if f returns Some v' it binds k to v', +if f returns None it removes k.

val cardinal : _ t ‑> int
val weight : _ t ‑> int
val fold : f:('b ‑> key ‑> 'a ‑> 'b) ‑> x:'b ‑> 'a t ‑> 'b
val mapi : f:(key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving both key and value. Will use WORD.of_list to rebuild keys.

  • Since: 0.17
val map : f:('a ‑> 'b) ‑> 'a t ‑> 'b t

Map values, giving only the value.

  • Since: 0.17
val iter : f:(key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val split : key ‑> 'a t ‑> 'a t * 'a option * 'a t

split k t returns l, o, r where l is the part of the map +with keys smaller than k, r has keys bigger than k, +and o = Some v if k, v belonged to the map.

val merge : f:(key ‑> 'a option ‑> 'b option ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

Like Map.S.merge.

val extract_min : 'a t ‑> key * 'a * 'a t

extract_min m returns k, v, m' where k,v is the pair with the +smallest key in m, and m' does not contain k.

  • Raises Not_found: if the map is empty.
val extract_max : 'a t ‑> key * 'a * 'a t

extract_max m returns k, v, m' where k,v is the pair with the +highest key in m, and m' does not contain k.

  • Raises Not_found: if the map is empty.
val choose : 'a t ‑> (key * 'a) option
val choose_exn : 'a t ‑> key * 'a
  • Raises Not_found: if the tree is empty.
val random_choose : Random.State.t ‑> 'a t ‑> key * 'a

Randomly choose a (key,value) pair within the tree, using weights +as probability weights.

  • Raises Not_found: if the tree is empty.
val add_list : 'a t ‑> (key * 'a) list ‑> 'a t
val of_list : (key * 'a) list ‑> 'a t
val to_list : 'a t ‑> (key * 'a) list
val add_seq : 'a t ‑> (key * 'a) sequence ‑> 'a t
val of_seq : (key * 'a) sequence ‑> 'a t
val to_seq : 'a t ‑> (key * 'a) sequence
val add_gen : 'a t ‑> (key * 'a) gen ‑> 'a t
val of_gen : (key * 'a) gen ‑> 'a t
val to_gen : 'a t ‑> (key * 'a) gen
val pp : key printer ‑> 'a printer ‑> 'a t printer

Renamed from val print.

  • Since: 2.0
\ No newline at end of file diff --git a/2.3/containers/CCZipper/.jbuilder-keep b/2.3/containers/CCZipper/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/CCZipper/index.html b/2.3/containers/CCZipper/index.html new file mode 100644 index 00000000..c75907a5 --- /dev/null +++ b/2.3/containers/CCZipper/index.html @@ -0,0 +1,11 @@ + +CCZipper (containers.CCZipper)

Module CCZipper

List Zipper

type 'a t = 'a list * 'a list

The pair l, r represents the list List.rev_append l r, but +with the focus on r

val empty : 'a t

Empty zipper.

val is_empty : _ t ‑> bool

Empty zipper? Returns true iff the two lists are empty.

val to_list : 'a t ‑> 'a list

Convert the zipper back to a list. +to_list (l,r) is List.rev_append l r.

val to_rev_list : 'a t ‑> 'a list

Convert the zipper back to a reversed list. +In other words, to_list (l,r) is List.rev_append r l.

val make : 'a list ‑> 'a t

Create a zipper pointing at the first element of the list.

val left : 'a t ‑> 'a t

Go to the left, or do nothing if the zipper is already at leftmost pos.

val left_exn : 'a t ‑> 'a t

Go to the left, or

  • Raises Invalid_argument: if the zipper is already at leftmost pos.
val right : 'a t ‑> 'a t

Go to the right, or do nothing if the zipper is already at rightmost pos.

val right_exn : 'a t ‑> 'a t

Go to the right, or

  • Raises Invalid_argument: if the zipper is already at rightmost pos.
val modify : ('a option ‑> 'a option) ‑> 'a t ‑> 'a t

Modify the current element, if any, by returning a new element, or +returning None if the element is to be deleted.

val insert : 'a ‑> 'a t ‑> 'a t

Insert an element at the current position. If an element was focused, +insert x l adds x just before it, and focuses on x.

val remove : 'a t ‑> 'a t

remove l removes the current element, if any.

val is_focused : _ t ‑> bool

Is the zipper focused on some element? That is, will focused +return a Some v?

val focused : 'a t ‑> 'a option

Return the focused element, if any. focused zip = Some _ iff +empty zip = false.

val focused_exn : 'a t ‑> 'a

Return the focused element, or

  • Raises Not_found: if the zipper is at an end.
val drop_before : 'a t ‑> 'a t

Drop every element on the "left" (calling left then will do nothing).

val drop_after : 'a t ‑> 'a t

Drop every element on the "right" (calling right then will do nothing), +keeping the focused element, if any.

val drop_after_and_focused : 'a t ‑> 'a t

Drop every element on the "right" (calling right then will do nothing), +including the focused element if it is present.

\ No newline at end of file diff --git a/2.3/containers/Containers/.jbuilder-keep b/2.3/containers/Containers/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/Containers/Hashtbl/Make/index.html b/2.3/containers/Containers/Hashtbl/Make/index.html new file mode 100644 index 00000000..6a64d417 --- /dev/null +++ b/2.3/containers/Containers/Hashtbl/Make/index.html @@ -0,0 +1,2 @@ + +Make (containers.Containers.Hashtbl.Make)

Module Containers.Hashtbl.Make

Parameters

H : Hashtbl.HashedType

Signature

type key = H.t
type 'a t = 'a Hashtbl.Make(H).t
val create : int ‑> 'a t
val clear : 'a t ‑> unit
val reset : 'a t ‑> unit
val copy : 'a t ‑> 'a t
val add : 'a t ‑> key ‑> 'a ‑> unit
val remove : 'a t ‑> key ‑> unit
val find : 'a t ‑> key ‑> 'a
val find_opt : 'a t ‑> key ‑> 'a option
val find_all : 'a t ‑> key ‑> 'a list
val replace : 'a t ‑> key ‑> 'a ‑> unit
val mem : 'a t ‑> key ‑> bool
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val filter_map_inplace : (key ‑> 'a ‑> 'a option) ‑> 'a t ‑> unit
val fold : (key ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
val length : 'a t ‑> int
val stats : 'a t ‑> Hashtbl.statistics
\ No newline at end of file diff --git a/2.3/containers/Containers/Hashtbl/MakeSeeded/argument-1-H/index.html b/2.3/containers/Containers/Hashtbl/MakeSeeded/argument-1-H/index.html new file mode 100644 index 00000000..6ee3e6f7 --- /dev/null +++ b/2.3/containers/Containers/Hashtbl/MakeSeeded/argument-1-H/index.html @@ -0,0 +1,2 @@ + +1-H (containers.Containers.Hashtbl.MakeSeeded.1-H)

Parameter Containers.Hashtbl.MakeSeeded.1-H

type t
val equal : t ‑> t ‑> bool
val hash : int ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/Containers/Hashtbl/MakeSeeded/index.html b/2.3/containers/Containers/Hashtbl/MakeSeeded/index.html new file mode 100644 index 00000000..2c54f0b7 --- /dev/null +++ b/2.3/containers/Containers/Hashtbl/MakeSeeded/index.html @@ -0,0 +1,2 @@ + +MakeSeeded (containers.Containers.Hashtbl.MakeSeeded)

Module Containers.Hashtbl.MakeSeeded

Parameters

Signature

type key = H.t
type 'a t
val create : ?⁠random:bool ‑> int ‑> 'a t
val clear : 'a t ‑> unit
val reset : 'a t ‑> unit
val copy : 'a t ‑> 'a t
val add : 'a t ‑> key ‑> 'a ‑> unit
val remove : 'a t ‑> key ‑> unit
val find : 'a t ‑> key ‑> 'a
val find_opt : 'a t ‑> key ‑> 'a option
val find_all : 'a t ‑> key ‑> 'a list
val replace : 'a t ‑> key ‑> 'a ‑> unit
val mem : 'a t ‑> key ‑> bool
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val filter_map_inplace : (key ‑> 'a ‑> 'a option) ‑> 'a t ‑> unit
val fold : (key ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
val length : 'a t ‑> int
val stats : 'a t ‑> statistics
\ No newline at end of file diff --git a/2.3/containers/Containers/Hashtbl/index.html b/2.3/containers/Containers/Hashtbl/index.html new file mode 100644 index 00000000..05fb87b8 --- /dev/null +++ b/2.3/containers/Containers/Hashtbl/index.html @@ -0,0 +1,22 @@ + +Hashtbl (containers.Containers.Hashtbl)

Module Containers.Hashtbl

include module type of Hashtbl with type Hashtbl.statistics = Hashtbl.statistics and module Hashtbl.Make = Hashtbl.Make and type ('a, 'b) Hashtbl.t = ('a'b) Hashtbl.t
type ('a, 'b) t = ('a'b) Hashtbl.t
val create : ?⁠random:bool ‑> int ‑> ('a'bt
val clear : ('a'bt ‑> unit
val reset : ('a'bt ‑> unit
val copy : ('a'bt ‑> ('a'bt
val add : ('a'bt ‑> 'a ‑> 'b ‑> unit
val find : ('a'bt ‑> 'a ‑> 'b
val find_opt : ('a'bt ‑> 'a ‑> 'b option
val find_all : ('a'bt ‑> 'a ‑> 'b list
val mem : ('a'bt ‑> 'a ‑> bool
val remove : ('a'bt ‑> 'a ‑> unit
val replace : ('a'bt ‑> 'a ‑> 'b ‑> unit
val iter : ('a ‑> 'b ‑> unit) ‑> ('a'bt ‑> unit
val filter_map_inplace : ('a ‑> 'b ‑> 'b option) ‑> ('a'bt ‑> unit
val fold : ('a ‑> 'b ‑> 'c ‑> 'c) ‑> ('a'bt ‑> 'c ‑> 'c
val length : ('a'bt ‑> int
val randomize : unit ‑> unit
val is_randomized : unit ‑> bool
type statistics = Hashtbl.statistics = {
num_bindings : int;
num_buckets : int;
max_bucket_length : int;
bucket_histogram : int array;
}
val stats : ('a'bt ‑> statistics
module type HashedType : sig ... end
module type S : sig ... end
module Make : functor (H : Hashtbl.HashedType) -> sig ... end
module type SeededHashedType : sig ... end
module type SeededS : sig ... end
module MakeSeeded : functor (H : SeededHashedType) -> sig ... end
val hash : 'a ‑> int
val seeded_hash : int ‑> 'a ‑> int
val hash_param : int ‑> int ‑> 'a ‑> int
val seeded_hash_param : int ‑> int ‑> int ‑> 'a ‑> int
include CCHashtbl.Poly
val get : ('a'b) Hashtbl.t ‑> 'a ‑> 'b option

Safe version of Hashtbl.find.

val get_or : ('a'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'b

get_or tbl k ~default returns the value associated to k if present, +and returns default otherwise (if k doesn't belong in tbl).

  • Since: 0.16
val keys : ('a'b) Hashtbl.t ‑> 'a CCHashtbl.sequence

Iterate on keys (similar order as Hashtbl.iter).

val values : ('a'b) Hashtbl.t ‑> 'b CCHashtbl.sequence

Iterate on values in the table.

val keys_list : ('a'b) Hashtbl.t ‑> 'a list

keys_list t is the list of keys in t. +If the key is in the Hashtable multiple times, all occurrences will be returned.

  • Since: 0.8
val values_list : ('a'b) Hashtbl.t ‑> 'b list

values_list t is the list of values in t.

  • Since: 0.8
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a'b) Hashtbl.t ‑> 'c list

Map on a hashtable's items, collect into a list.

val incr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

incr ?by tbl x increments or initializes the counter associated with x. +If get tbl x = None, then after update, get tbl x = Some 1; +otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • Parameter by: if specified, the int value is incremented by by rather than 1.
  • Since: 0.16
val decr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

Like incr but subtract 1 (or the value of by). +If the value reaches 0, the key is removed from the table. +This does nothing if the key is not already present in the table.

  • Since: 0.16
val to_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) CCHashtbl.sequence

Iterate on bindings in the table.

val add_list : ('a'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unit

add_list tbl x y adds y to the list x is bound to. If x is +not bound, it becomes bound to y.

  • Since: 0.16
val add_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) CCHashtbl.sequence ‑> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • Since: 0.16
val of_seq : ('a * 'b) CCHashtbl.sequence ‑> ('a'b) Hashtbl.t

From the given bindings, added in order.

val add_seq_count : ('a, int) Hashtbl.t ‑> 'a CCHashtbl.sequence ‑> unit

add_seq_count tbl seq increments the count of each element of seq +by calling incr. This is useful for counting how many times each +element of seq occurs.

  • Since: 0.16
val of_seq_count : 'a CCHashtbl.sequence ‑> ('a, int) Hashtbl.t

Like add_seq_count, but allocates a new table and returns it.

  • Since: 0.16
val to_list : ('a'b) Hashtbl.t ‑> ('a * 'b) list

List of bindings (order unspecified).

val of_list : ('a * 'b) list ‑> ('a'b) Hashtbl.t

Build a table from the given list of bindings k_i -> v_i, +added in order using add. If a key occurs several times, +it will be added several times, and the visible binding +will be the last one.

val update : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b option ‑> 'b option) ‑> k:'a ‑> unit

update tbl ~f ~k updates key k by calling f k (Some v) if +k was mapped to v, or f k None otherwise; if the call +returns None then k is removed/stays removed, if the call +returns Some v' then the binding k -> v' is inserted +using Hashtbl.replace.

  • Since: 0.14
val get_or_add : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'b

get_or_add tbl ~k ~f finds and returns the binding of k +in tbl, if it exists. If it does not exist, then f k +is called to obtain a new binding v; k -> v is added +to tbl and v is returned.

  • Since: 1.0
val pp : 'a CCHashtbl.printer ‑> 'b CCHashtbl.printer ‑> ('a'b) Hashtbl.t CCHashtbl.printer

Printer for table. +Renamed from print since 2.0.

  • Since: 0.13
module type S' = CCHashtbl.S
module Make' = CCHashtbl.Make
\ No newline at end of file diff --git a/2.3/containers/Containers/Hashtbl/module-type-HashedType/index.html b/2.3/containers/Containers/Hashtbl/module-type-HashedType/index.html new file mode 100644 index 00000000..5ebe8dd7 --- /dev/null +++ b/2.3/containers/Containers/Hashtbl/module-type-HashedType/index.html @@ -0,0 +1,2 @@ + +HashedType (containers.Containers.Hashtbl.HashedType)

Module type Containers.Hashtbl.HashedType

type t
val equal : t ‑> t ‑> bool
val hash : t ‑> int
\ No newline at end of file diff --git a/2.3/containers/Containers/Hashtbl/module-type-S'/index.html b/2.3/containers/Containers/Hashtbl/module-type-S'/index.html new file mode 100644 index 00000000..7302c395 --- /dev/null +++ b/2.3/containers/Containers/Hashtbl/module-type-S'/index.html @@ -0,0 +1,22 @@ + +S' (containers.Containers.Hashtbl.S')

Module type Containers.Hashtbl.S'

include Hashtbl.S
type key
type 'a t
val create : int ‑> 'a t
val clear : 'a t ‑> unit
val reset : 'a t ‑> unit
val copy : 'a t ‑> 'a t
val add : 'a t ‑> key ‑> 'a ‑> unit
val remove : 'a t ‑> key ‑> unit
val find : 'a t ‑> key ‑> 'a
val find_opt : 'a t ‑> key ‑> 'a option
val find_all : 'a t ‑> key ‑> 'a list
val replace : 'a t ‑> key ‑> 'a ‑> unit
val mem : 'a t ‑> key ‑> bool
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val filter_map_inplace : (key ‑> 'a ‑> 'a option) ‑> 'a t ‑> unit
val fold : (key ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
val length : 'a t ‑> int
val stats : 'a t ‑> Hashtbl.statistics
val get : 'a t ‑> key ‑> 'a option

Safe version of Hashtbl.find.

val get_or : 'a t ‑> key ‑> default:'a ‑> 'a

get_or tbl k ~default returns the value associated to k if present, +and returns default otherwise (if k doesn't belong in tbl).

  • Since: 0.16
val add_list : 'a list t ‑> key ‑> 'a ‑> unit

add_list tbl x y adds y to the list x is bound to. If x is +not bound, it becomes bound to y.

  • Since: 0.16
val incr : ?⁠by:int ‑> int t ‑> key ‑> unit

incr ?by tbl x increments or initializes the counter associated with x. +If get tbl x = None, then after update, get tbl x = Some 1; +otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • Parameter by: if specified, the int value is incremented by by rather than 1.
  • Since: 0.16
val decr : ?⁠by:int ‑> int t ‑> key ‑> unit

Like incr but subtract 1 (or the value of by). +If the value reaches 0, the key is removed from the table. +This does nothing if the key is not already present in the table.

  • Since: 0.16
val keys : 'a t ‑> key CCHashtbl.sequence

Iterate on keys (similar order as Hashtbl.iter).

val values : 'a t ‑> 'a CCHashtbl.sequence

Iterate on values in the table.

val keys_list : _ t ‑> key list

keys_list t is the list of keys in t. +If the key is in the Hashtable multiple times, all occurrences will be returned.

  • Since: 0.8
val values_list : 'a t ‑> 'a list

values_list t is the list of values in t.

  • Since: 0.8
val map_list : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b list

Map on a hashtable's items, collect into a list.

val to_seq : 'a t ‑> (key * 'a) CCHashtbl.sequence

Iterate on values in the table.

val of_seq : (key * 'a) CCHashtbl.sequence ‑> 'a t

From the given bindings, added in order.

val add_seq : 'a t ‑> (key * 'a) CCHashtbl.sequence ‑> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • Since: 0.16
val add_seq_count : int t ‑> key CCHashtbl.sequence ‑> unit

add_seq_count tbl seq increments the count of each element of seq +by calling incr. This is useful for counting how many times each +element of seq occurs.

  • Since: 0.16
val of_seq_count : key CCHashtbl.sequence ‑> int t

Like add_seq_count, but allocates a new table and returns it.

  • Since: 0.16
val to_list : 'a t ‑> (key * 'a) list

List of bindings (order unspecified).

val of_list : (key * 'a) list ‑> 'a t

Build a table from the given list of bindings k_i -> v_i, +added in order using add. If a key occurs several times, +it will be added several times, and the visible binding +will be the last one.

val update : 'a t ‑> f:(key ‑> 'a option ‑> 'a option) ‑> k:key ‑> unit

update tbl ~f ~k updates key k by calling f k (Some v) if +k was mapped to v, or f k None otherwise; if the call +returns None then k is removed/stays removed, if the call +returns Some v' then the binding k -> v' is inserted +using Hashtbl.replace.

  • Since: 0.14
val get_or_add : 'a t ‑> f:(key ‑> 'a) ‑> k:key ‑> 'a

get_or_add tbl ~k ~f finds and returns the binding of k +in tbl, if it exists. If it does not exist, then f k +is called to obtain a new binding v; k -> v is added +to tbl and v is returned.

  • Since: 1.0

Printer for tables. +Renamed from print since 2.0.

  • Since: 0.13
\ No newline at end of file diff --git a/2.3/containers/Containers/Hashtbl/module-type-S/index.html b/2.3/containers/Containers/Hashtbl/module-type-S/index.html new file mode 100644 index 00000000..1fc7cd07 --- /dev/null +++ b/2.3/containers/Containers/Hashtbl/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (containers.Containers.Hashtbl.S)

Module type Containers.Hashtbl.S

type key
type 'a t
val create : int ‑> 'a t
val clear : 'a t ‑> unit
val reset : 'a t ‑> unit
val copy : 'a t ‑> 'a t
val add : 'a t ‑> key ‑> 'a ‑> unit
val remove : 'a t ‑> key ‑> unit
val find : 'a t ‑> key ‑> 'a
val find_opt : 'a t ‑> key ‑> 'a option
val find_all : 'a t ‑> key ‑> 'a list
val replace : 'a t ‑> key ‑> 'a ‑> unit
val mem : 'a t ‑> key ‑> bool
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val filter_map_inplace : (key ‑> 'a ‑> 'a option) ‑> 'a t ‑> unit
val fold : (key ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
val length : 'a t ‑> int
val stats : 'a t ‑> statistics
\ No newline at end of file diff --git a/2.3/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html b/2.3/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html new file mode 100644 index 00000000..e7c21d46 --- /dev/null +++ b/2.3/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html @@ -0,0 +1,2 @@ + +SeededHashedType (containers.Containers.Hashtbl.SeededHashedType)

Module type Containers.Hashtbl.SeededHashedType

type t
val equal : t ‑> t ‑> bool
val hash : int ‑> t ‑> int
\ No newline at end of file diff --git a/2.3/containers/Containers/Hashtbl/module-type-SeededS/index.html b/2.3/containers/Containers/Hashtbl/module-type-SeededS/index.html new file mode 100644 index 00000000..906f36c0 --- /dev/null +++ b/2.3/containers/Containers/Hashtbl/module-type-SeededS/index.html @@ -0,0 +1,2 @@ + +SeededS (containers.Containers.Hashtbl.SeededS)

Module type Containers.Hashtbl.SeededS

type key
type 'a t
val create : ?⁠random:bool ‑> int ‑> 'a t
val clear : 'a t ‑> unit
val reset : 'a t ‑> unit
val copy : 'a t ‑> 'a t
val add : 'a t ‑> key ‑> 'a ‑> unit
val remove : 'a t ‑> key ‑> unit
val find : 'a t ‑> key ‑> 'a
val find_opt : 'a t ‑> key ‑> 'a option
val find_all : 'a t ‑> key ‑> 'a list
val replace : 'a t ‑> key ‑> 'a ‑> unit
val mem : 'a t ‑> key ‑> bool
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val filter_map_inplace : (key ‑> 'a ‑> 'a option) ‑> 'a t ‑> unit
val fold : (key ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
val length : 'a t ‑> int
val stats : 'a t ‑> statistics
\ No newline at end of file diff --git a/2.3/containers/Containers/index.html b/2.3/containers/Containers/index.html new file mode 100644 index 00000000..f37c609a --- /dev/null +++ b/2.3/containers/Containers/index.html @@ -0,0 +1,2 @@ + +Containers (containers.Containers)

Module Containers

Drop-In replacement to Stdlib

module Array = CCArray
module ArrayLabels = CCArrayLabels
module Array_slice = CCArray_slice
module Bool = CCBool
module Char = Char
module Equal = CCEqual
module Float = CCFloat
module Format = CCFormat
module Fun = CCFun
module Hash = CCHash
module Hashtbl : sig ... end
module Heap = CCHeap
module Int = CCInt
module Int32 = CCInt32
module Int64 = CCInt64
module IO = CCIO
module List = CCList
module ListLabels = CCListLabels
module Map = CCMap
module Nativeint = CCNativeint
module Option = CCOpt
module Ord = CCOrd
module Pair = CCPair
module Parse = CCParse
module Random = CCRandom
module Ref = CCRef
module Result = CCResult
module Set = CCSet
module String = CCString
module Vector = CCVector
module Monomorphic = CCMonomorphic
module Utf8_string = CCUtf8_string
include Monomorphic

Shadow unsafe functions and operators from Pervasives

  • Since: 2.0
val (=) : int ‑> int ‑> bool
val (<>) : int ‑> int ‑> bool
val (<) : int ‑> int ‑> bool
val (>) : int ‑> int ‑> bool
val (<=) : int ‑> int ‑> bool
val (>=) : int ‑> int ‑> bool
val compare : int ‑> int ‑> int
val min : int ‑> int ‑> int
val max : int ‑> int ‑> int

Infix operators for Floats

val (=.) : float ‑> float ‑> bool
  • Since: 2.1
val (<>.) : float ‑> float ‑> bool
  • Since: 2.1
val (<.) : float ‑> float ‑> bool
  • Since: 2.1
val (>.) : float ‑> float ‑> bool
  • Since: 2.1
val (<=.) : float ‑> float ‑> bool
  • Since: 2.1
val (>=.) : float ‑> float ‑> bool
  • Since: 2.1

Shadow Dangerous Operators

val (==) : [ `Consider_using_CCEqual_physical ]
  • Deprecated Please use CCEqual.physical or Pervasives.(==) instead.
val (!=) : [ `Consider_using_CCEqual_physical ]
  • Since: 2.1
  • Deprecated Please use [not CCEqual.physical] or Pervasives.(!=) instead.
\ No newline at end of file diff --git a/2.3/containers/Containers_top/.jbuilder-keep b/2.3/containers/Containers_top/.jbuilder-keep new file mode 100644 index 00000000..e69de29b diff --git a/2.3/containers/Containers_top/index.html b/2.3/containers/Containers_top/index.html new file mode 100644 index 00000000..c08012fe --- /dev/null +++ b/2.3/containers/Containers_top/index.html @@ -0,0 +1,2 @@ + +Containers_top (containers.Containers_top)

Module Containers_top

type 'a printer = Format.formatter ‑> 'a ‑> unit
val eval_exn : string ‑> bool
val install_printer : string ‑> unit
val install_printers : string list ‑> unit
\ No newline at end of file diff --git a/2.3/containers/index.html b/2.3/containers/index.html new file mode 100644 index 00000000..a0e35067 --- /dev/null +++ b/2.3/containers/index.html @@ -0,0 +1,20 @@ + +index (containers.index)

Library containers

+This library exposes the following toplevel modules: +

CCArray
CCArrayLabels
CCArray_slice
CCBool
CCChar
CCEqual
CCFloat
CCFormat
CCFun
CCHash
CCHashtbl
CCHeap
CCIO
CCInt
CCInt32
CCInt64
CCList
CCListLabels
CCMap
CCNativeint
CCOpt
CCOrd
CCPair
CCParse
CCRandom
CCRef
CCResult
CCSet
CCString
CCUtf8_string
CCVector
Containers

Library containers.data

+This library exposes the following toplevel modules: +

CCBV
CCBijection
CCBitField
CCCache
CCDeque
CCFQueue
CCFun_vec
CCGraph
CCHashSet
CCHashTrie
CCHet
CCImmutArray
CCIntMap
CCMixmap
CCMixset
CCMixtbl
CCMultiMap
CCMultiSet
CCPersistentArray
CCPersistentHashtbl
CCRAL
CCRingBuffer
CCSimple_queue
CCTrie
CCWBTree
CCZipper

Library containers.iter

+This library exposes the following toplevel modules: +

CCKList
CCKTree
CCLazy_list

Library containers.monomorphic

+The entry point of this library is the module: +CCMonomorphic. +

Library containers.sexp

+This library exposes the following toplevel modules: +

CCSexp
CCSexp_lex

Library containers.thread

+This library exposes the following toplevel modules: +

CCBlockingQueue
CCLock
CCPool
CCSemaphore
CCThread
CCTimer

Library containers.top

+The entry point of this library is the module: +Containers_top. +

Library containers.unix

+The entry point of this library is the module: +CCUnix.

\ No newline at end of file diff --git a/2.3/index.html b/2.3/index.html new file mode 100644 index 00000000..759e3dfb --- /dev/null +++ b/2.3/index.html @@ -0,0 +1,17 @@ + + + + index + + + + + +
+

OCaml package documentation

+
    +
  1. containers 2.3
  2. +
+
+ + \ No newline at end of file diff --git a/2.3/odoc.css b/2.3/odoc.css new file mode 100644 index 00000000..e7808926 --- /dev/null +++ b/2.3/odoc.css @@ -0,0 +1,234 @@ +@charset "UTF-8"; +/* Copyright (c) 2016 Daniel C. Bünzli. All rights reserved. + Distributed under the ISC license, see terms at the end of the file. + odoc 1.2.0 */ + +/* Reset a few things. */ + +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre, +a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp, +small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li, +fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td, +article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup, +menu,nav,output,ruby,section,summary,time,mark,audio,video +{ margin:0; padding:0; border:0; /* outline: 0; */ + font-size:100%; font: inherit; line-height:inherit; vertical-align:baseline; + text-align: inherit; color: inherit; background: transparent; } + +table { border-collapse: collapse; border-spacing: 0; } +*, *:before, *:after { box-sizing: border-box; } + +body +{ font-family: Helvetica, "DejaVu Sans", Arial, sans-serif; + font-weight: normal; + font-size: 0.875rem; + line-height:1.25rem; + text-align: left; + min-width: 40ex; + max-width: 78ex; + padding: 1.25rem; + margin-left: 3.75rem; + color: #222; background: #FAFAFA; } + +/* Basic markup elements */ + +b, strong { font-weight: bold; } +em { font-style: italic; } + +sup { vertical-align: super; } +sub { vertical-align: sub; } +sup, sub { font-size : 0.75rem; line-height: 0; margin-left: 0.2ex; } + +p, div, img { margin-top: 1.25rem; } + +ul, ol +{ margin-top: 0.625rem; margin-bottom: 0.625rem; list-style-position: outside } + +ul { list-style-type: square } +ul > li { margin-left: 1.375rem; } +ol > li { margin-left: 1.7rem; } +li > *:first-child { margin-top: 0 } + +/* Text alignements, this should be forbidden. */ + +.left { text-align: left; } +.right { text-align: right; } +.center { text-align: center; } + +/* Links and anchors */ + +a { text-decoration:none; color:#2C5CBD; } +a:hover { box-shadow:0 1px 0 0 #2C5CBD; } +*:target /* Linked highlight */ +{ background-color: #FFF8E5; + box-shadow: 0 0 0 2px #FFF8E5, 0 0 0 3px #DDD; } + +.spec:hover > a.anchor, /* FIXME remove */ +.anchored:hover a.anchor { visibility: visible; } + +a.anchor:before { content: "#" } +a.anchor:hover { box-shadow: none; text-decoration: underline } +a.anchor +{ visibility: hidden; position: absolute; /* top: 0px; */ + margin-left: -3ex; + font-weight: normal; + font-style: normal; + padding-right: 1ex; padding-left: 1ex; /* To remain selectable */ + color: #AAA; } + +.xref-unresolved { box-shadow:0 1px 0 0 red } + +/* Section and document divisions. + Until at least 4.03 many of the modules of the stdlib start at .h7, + we restart the sequence there like h2 */ + +h1, h2, h3, h4, h5, h6, .h7, .h8, .h9, .h10 +{ font-weight: bold; margin-top: 1.25rem; } + +h1 + *, h2 + *, .h7 + * { margin-top: 0.625rem; } +h1, h2, .h7 +{ font-size: 1.25rem; + line-height: 2.4375rem; /* 2.5rem - border width */ + padding-top: 0.625rem; + border-top: solid; + border-width: 1px; + border-color: #DDD; } + +h3, .h8 { font-size: 1.125rem; } +h2 + h3, .h7 + .h8 { margin-top: 0.625rem; } + +/* Preformatted and code */ + +tt, code, pre +{ font-family: Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", + monospace; + font-weight: normal; + font-size: 0.75rem; } + +pre +{ padding-left: 0.25rem; padding-right: 0.25rem; + margin-left: -0.25rem; margin-right: -0.25rem; + padding-top: 0.3125rem; padding-bottom: 0.3125rem; + margin-top: 1.25rem; /* margin-bottom: 0.625rem; */ + line-height: 1.1875rem; + background: #F1F1F1; } + +h1 tt, h1 code, h2 tt, h2 code, .h7 tt, .h7 code { font-size: 1.125rem } +h3 tt, h3 code { font-size: 1rem } + +/* Code lexemes */ + +.keyword { font-weight: bold; } + +/* Module member specification */ + +div.def { margin-top: 0rem; text-indent: -2ex; padding-left: 2ex; } +div.def + div.doc { margin-left: 1ex; margin-top: 0.15625rem } +div.doc > *:first-child { margin-top: 0rem; } + +/* Collapsible inlined include and module */ + +details +{ border-radius: 0.5rem; + border-left: 0.2rem solid; + border-color: #FAFAFA /* Background */; + margin-left: -1.5rem; + padding-left: 1.3rem; + padding-bottom: 0.625rem; } + +details[open] { border-color: #AAA; } + +/* Records and variants FIXME */ + +div.def table { text-indent: 0em; padding:0; margin-left: -2ex; } +td.def { padding-right: 2ex } +.record td.def { padding-left:2ex; } +td.doc *:first-child { margin-top: 0em } + +/* @ tags */ + +ul.at-tag { list-style-type: none; margin-left: 0; padding: 0; } +ul.at-tag li { margin-left:0; padding:0; } +ul.at-tag li p:first-child { margin-top: 0 } /* FIXME remove */ +span.at-tag { font-weight: bold } +.at-tag.deprecated { font-weight: normal; color: crimson } +.at-tag.raise { font-weight: bold; } + +/* FIXME random other things to review. */ + +.heading +{ margin-top: 0.625rem; + border-top: solid; + border-width: 1px; + border-color: #DDD; + text-align: right; + font-weight: normal; + font-style: italic; } + +.heading + .sig { margin-top: -1.25rem; } +.heading + .parameters { margin-top: -1.25rem; } + +/* Odig package index */ + +.by-name ol, .by-tag ol, .errors ol { list-style-type: none; margin-left:0; } +.by-name ol ol, .by-tag ol ol { margin-top:0; margin-bottom: 0 } +.by-name li, .by-tag li, .errors li { margin-left:0; } + +.by-name .version { font-size: 0.625rem; color: #AAA } +.by-name nav { margin-bottom: 0.625rem } +.by-name nav a +{ text-transform: uppercase; font-size: 1.125rem; + margin-right:1ex; color: #222; display: inline-block; } + +.by-tag nav a { margin-right:1ex; color: #222; display: inline-block; } +.by-tag > ol > li { margin-top: 0.625rem; } +.by-tag > ol > li > span, +.by-tag > ol > li > ol, +.by-tag > ol > li > ol > li { display: inline-block; margin-right: 1ex; } + +/* Odig package page */ + +.package nav { display: inline; font-size: 0.875rem; font-weight: normal; } +.package .version { font-size: 0.875rem; } + +h1 + .modules, h1 + .sel { margin-top: 0.625rem } +.sel { font-weight: normal; font-style: italic; + font-size:0.875rem; margin-top:1.25rem; } +.sel + .modules { margin-top:0.625rem; + margin-bottom: 1.25rem; margin-left: 1ex; } + +.modules { margin:0; } +.modules .module { min-width:8ex; padding-right: 2ex } + +.package.info { margin: 0;} +.package.info td:first-child { font-style: italic; padding-right: 2ex; } +.package.info ul { list-style-type: none; display: inline; margin:0; } +.package.info li { display: inline-block; margin:0; margin-right:1ex; } +#info-authors li, #info-maintainers li { display:block; } + +/* Mobile adjustements. */ + +@media only screen and (max-width: 78ex) +{ body { margin: auto; } } + +/* Print adjustements. */ + +@media print +{ body { color: black; background: white; } + body nav:first-child { visibility: hidden; }} + +/*--------------------------------------------------------------------------- + Copyright (c) 2016 Daniel C. Bünzli + + Permission to use, copy, modify, and/or 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. + ---------------------------------------------------------------------------*/ diff --git a/index.md b/index.md index 43ff3e1d..c5d1c8d4 100644 --- a/index.md +++ b/index.md @@ -16,6 +16,7 @@ contains a tutorial and more explanations about what Containers is about. ## by version - [current](last) +- [2.3](2.3) - [2.2](2.2) - [2.1](2.1) - [2.0](2.0) diff --git a/last b/last index 61618788..c0943d3e 120000 --- a/last +++ b/last @@ -1 +1 @@ -2.2 \ No newline at end of file +2.3 \ No newline at end of file