HOOG//|"!';;AACC:<>\_a !!))+.259;GGIJLMVcknppzzb IN^_ddhhnnpp||c -.25DFWX\\``nnqqss}~d   (+/055:=UUggjje (+.014488:FHKNSUUX_ahjjllnprx||f&8:;INg  9<RRjjww}~h''++00347;?CEFRRXZ]]__aaccfflnuvi &+0028<NUUXZ\]_cefklv|jk''004488??BCFFOQTUXXZ]__aaccffll{{l !"$$&'+028??RUiinnppwwy~m!%)*28:;GGIJLMVfhh|~n (.55<HRRUU\\``eiklssww}~o /8:;??DFINTU\\``ghjlppuw{{}p #%9;??GGIMTakmy~qrsr %'1<>FIKYZddhhjlnpuv|s  ""-.18:;>FHNPQSS[]ooqt !!#'+.08>HKKNNQRXZ\]_accffhhjmpptwyu  ++??INTUWXijss{{vSSbcefoow''++003478?CEFXXZZ]]__aceflluvx()==UUbcy#%''004488??BCFFJJMMOQXXZ_aaccffll}~zxx|]ĈL.'U Y y()'->`'All?'Any'ArithException'Array 'ArrayException&AsyncException&Bool& BufferMode& BufferState&CCharS&CClock!&CDev%CDouble%CFloat=%CIno$CInt$CIntMaxe$CIntPtr$CLDouble#CLLong|#CLong4#CMode"COff"CPid\"CPtrdiff"CSChar!CShort! CSigAtomicBounds:. ByteCount2.CDir-.CDirent(.CFLock#.CGroup.CLconv.CPasswd. CSigaction.CSigset .CStat.CString- CStringLen-CTermios-CTm-CTms-CUtimbuf-CUtsname-CWString- CWStringLen- ClockTick-ConIndex-DeviceID- DiffArraye- DiffUArrayI-Edge7- EpochTime/-FD(-FileID!-FileMode- FileOffset-FilePath-FinalizerEnvPtr, FinalizerPtr,Forest,Generic,GenericB,GenericMw,GenericQl,GenericRa,GenericTX,Graph>,HandlePosition4,IOError&,IPr,Key,Limit, ListUArray+Micro+Pico+Prec+ProcessGroupID+ ProcessID+Rational+ RawBufferv+ReadSI+STRep+ SampleVar*ShowS*String*Table*Vertex*IntaArrayInta[]Char[]Char[]CharaMVar(,)IntMVarasaState#s(#,#)State#saa[]Char[](,)a[]CharMutableByteArray# RealWorldRatioIntegerCPidCPidIntFixedE12FixedE6e(,)ii[]eUArrayieCLongInt(,)IntInt IOExceptionIntegerArrayInt[]Intaammararmamaacacaa[]TreeaaFunPtrPtraIO()envaFunPtrPtrenvPtraIO()[]CharCOffCModeCInoCIntCTime(,)IntInt IOToDiffArrayIOUArray IOToDiffArrayIOArrayCDevIntCClock(,)PtrCWcharIntPtrCWchar()()()()()(,)PtrCCharIntPtrCChar()()()()()()()()()CSize(,)IntInt(:}[Iabr~c*rdXmeifcgahI_iWjOWkVlSmPnMoHJp=FqFr?s?9t5u2vK2w/z.i.p.l.i.s.t.ZipList#A21'23 26181e1o0r:/a/iF/tM/eT/b/h/me/ol/ds/ez/IOModea/n/d/l/e/ HandleTypeu/f/f/e/r/ BufferStatep/a0m0p0e 0d0aQ0m0o&0n-0a40d;0 WrappedMonadrX0r_0of0wm0 WrappedArrowo0n0a0d0 WrappedMonadr0r0o0w0 WrappedArrowr0d0Word#1113t16G1881p1t 1r'1WordPtrWord84N1Word64#c1Word64#2{1Word3261Word16Word#a1k1Weak#1Weak##1Word841#2Word6422#2Word326.2#52Word16Worde2iW2e^2we2l2rq2ViewRViewLr2s2t2e2x2Vertexi2o2n2Versiona5n3p>3s2e3r 3e3r3r3o&3r-3 IOErrorTypepE3eL3rS3cZ3aa3sh3eo3lv3e}3t3t3e3r3GeneralCategoryd5i4s3aL4u3p3p3o3r3t3e3d3o4p 4e4r4a4t&4i-4o44n;4 IOErrorTypetS4iZ4sa4fh4io4ev4d}4c4o4n4s4t4r4a4i4n4t4s4 IOErrorTypeq4t4Unitu4e5Uniquee5fV5r&5f-5l45o;5wB5ArithExceptioni]5nd5ek5dr5ey5l5e5m5e5n5t5ArrayExceptionr5r5a5y5UArraya9h8i7rI7v-7y6c7p6e6aA6r"6e)6p06TypeRepbH6lO6eV6Typeable16263646566676 Typeable7 Typeable6 Typeable5 Typeable4 Typeable3 Typeable2 Typeable1o7n7TyCona47r;7TVara7ek7uZ7ea7Booler7Treev7e7r7s7a7b7l7e7 TraversablemB8t7l7e7c7a7s7e8l 8e8t8t8e&8r-8GeneralCategoryeI8eP8xW8p^8ie8rl8es8dz8 IOErrorTyper8e8a8d8i8k8i8l8l8e8d8AsyncExceptiond8ThreadId#9 ThreadId#b"9l)9e09Table #?ar?c^?eQ>h=i=p=tA:u9ys9m9s9t9e9m9e9r9r9o9r9 IOErrorTypeb9o9l9Lexemem4:r9r9o:g :a:t:e:GeneralCategorySumSTa;m;or;r:uf:am:rt:r{:a:y:STUArraye;i:n:g:Stringc:r:e:p:DataRepo:n:s:t;r ; ConstrRepa_;fP;pA;t2;STretSTRepSTRefmf;FDTypery;a;b;l;e;Storablea;r;r;a;y; StorableArraySTMb<cF<r <t<e <#<State#r'<a.<y5<STArraykM<oT<v[<eb<ri<fp<lw<o~<w<AsyncExceptionl<e<n<p<t<r< StablePtr#< StablePtr#a<m<e= StableNamea=c$=e=i0=n7=g>=cE=oL=mS=bZ=ia=nh=io=nv=g}=m=a=r=k=GeneralCategoryGeneralCategoryz=e=d=Sizedo(>u=t=d>o>w>n> ConsoleEventw/>ShowsB>ShowSe>m>qt>tg>SetSeqi>c>l>o>s>e>d>h>a>n>d>l>e> HandleTypek>f&?m>o?d ?e?SeekModer-?o4?m;?eB?nI?dP?SeekModece?SCCmy?p?l?e?v?a?r? SampleVarIntegera=Ee?i?g?h?t?Eithera#CcRBgBlAqSAsn@t@u!@r(@n/@i6@n=@oD@rK@dR@eY@r`@ArgOrderou@u|@r@c@e@b-Ae@v@a@n@i@s@h@e@d@ IOErrorTypex@h@a@uAsAtAeAdA IOErrorTypeu4As;AyBA IOErrorTypeaAu_AifArmAetAo{ArAdAeArAArgOrderrAgAArgDescraAtAiAvAeAsAeAeAkBSeekModeuBlBa#Br*Bf1Bi8Bl?BeFBFDTypecBsBucBpjBdqBexBrBrBoBrB ExceptioneBlBeBrBrBoBrB ExceptionoBnBeBrBrCo CrC ExceptiondCl/CRealfvCwGCoNCrUCl\CdcC RealWorldlCrCaCcCRealFracoCaCtC RealFloatReadb EhDmDpDsrDwCrCiDt DeDh?DmDo%Dd,De3DIOModeaFDnMDdTDl[DebD HandleTypeReadSReadPrDeDcDReadPrecoDdDeDIOModeaDnDdDlDeD HandleTypeuEfEfEe%Er,E BufferStatetEwIEbEdUEe\EvcEijEcqEexEFDTypeuEfEfEeErE RawBufferLexemeiEoERationEaElERationals FeFmFQSemn.FQSemNaTIeHiHoHrFt|FubFniFcpFLexemerFPtreTHiGoFc(GdGtFoFcFoFlFeFrFrFoFrF IOErrorTypeu GcGtGProducte/Gs6Gs=GgcGiIGdPG ProcessIDrjGoqGuxGpGiGdGProcessGroupIDnGvGaGtGeGuGsGeGGeneralCategorytGfGa3Ht HyHpHeH PrintfTyper:HgAH PrintfArgczHf`HigHxnHFixityPrecoHlHPoolcHoHPicorHmHiHuHtHeHArgOrdersHsIi IoInId Ie'In.Ii5IeetEeeLenSetZesaeForeignPtrContentsdeaebeleeeFoldableoeaeteFloat#Wfc%fifreeepeDataRepn fgfFloatingo,fn3fs:ftAfrHf ConstrRepFloat#lgnfrfx}fefiftfyfFixitydfFixedsftfFirstaflfi%gqfufogt gegGeneralCategoryz,ge3gr:gejgpFgtMgrTg FinalizerPtrnqgvxgpgtgrgFinalizerEnvPtreghdhiMhm&hogpgagtghgFilePathfgfgshe hth FileOffseto-hd4he;hFileModedThFileIDakhnrhdyhlhehHandlee9ifhghehnhehrhihchFFFormatiiohrhmhahtiFFFormatxie$id+iFFFormatx@ipGioNinUie\incitjiFFFormatFDFdtiyipieiFDTypelisieiBoolFloat 1Dm68mdmilmln#lolpkqkr\kxjcki$jt+jcjejfyjsAjuHjcOjcVje]jsdjskjExitCodeajijljujrjejExitCodexjcjejpjtjijojnj Exceptionojdke kExitCodee&kp-kt4ki;koBknIk Exceptionrcknkookrvkc}kaklklk ExceptionokErrnoOrderingEqokckhktkikmkek EpochTimeflLexemec^ldIlu4lm;lEnumoPlEndolelollsslizlnlglmlalrlklGeneralCategorypltlylllrlViewRViewLtlhlemr mEitherg#me*mEdgeE62KmE12#ra;qeoinonu=ny}mnmanemimomemrmrmomrm IOErrorTypexmcmempmtmimonnn Exceptionmni%nc,nDynamicanpInlPneWnx^nhenalnnsndznlnenHandlelnDualunbnlnenDouble#nDouble#forOovniod oeoboyoz&oe-or4oo;oArithExceptioneVoc]otdookorroyyoFDTypefoaouoaororoaoyo DiffUArrayroroaoyo DiffArraya qcpfpnNpvpi pc'pe.pi5pdsCWcharcuitletrtsstnsisszsnsasmsesCUtsnamemsbsusfsCUtimbufhsosrstsCUShortr tetntcty&ts-ty4tm;tbBtoItlPtGeneralCategoryltoqtnxtgtCULongotntgtCULLongntttCUIntmtptttrtCUIntPtraux uCUIntMaxh#ua*ur1uCUChareuirumRuCTmsduCTmsmyueuCTimerumuiuousuCTermioscQwh,wisvsNvtua8vruiunugvCStringlvevn$v CStringLent?vCStatiUvz\vecvCSsizegvzvevCSizeavsvevtvCSigsetcvtvovmvivcv CSigAtomictwi wownw CSigactiono3wr:wtAwCShorthXwa_wrfwCSCharawiwtwrwdwiwfwfwCPtrdiffdwCPidswswwwdwCPasswdfymynxiynysfxt%xr,xo3xl:xGeneralCategorycTx ConsoleEventoxtrxConstrxConstrrxexpx ConstrReplxexexvxexnxtx ConsoleEvente ycytyoyr&yp-yu4yn;ycBytIyuPyaWyt^yieyolynsyGeneralCategorynydyeyxyConIndexpylyeyxyComplexfyCOffoydze zCModec{dl{lG{o2zc{nzsCzeJz ConsoleEventdzpfzumzntzc{ztzuzaztzizoznzGeneralCategoryhzaznzdzlzez HandleTypeg{CLongk{t{i&{c-{k4{ ClockTickoN{nU{g\{CLLongos{uz{b{l{e{CLDoubleo{n{v{CLconvm{p{b{u{f{CJmpBufn|oc|t |CIntmD|p%|t,|r3|CIntPtraK|xR|CIntMaxCInoax|n|r|Char#|Char#Chanr|o|u|p|CGroupiO}l}p|o|s|CFposo}a8}c!}k(}CFLockt?}CFloatlV}e]}CFilee}i}o}}u}b}l}e}CDoubler}CDire}n}t}CDirentv}CDevh)~l~o ~c~k~CClocka0~r7~CChartM~cT~h[~HandlerCharíloDruy~t~e~a~c~o~u~n~t~ ByteCountr~r~a~y~#~ ByteArray#ff e'r.Bufferlm~sMtTa[tbei BufferStateode BufferModeist BufferListcnil BufferListons  BufferListe$a+k2 ConsoleEventouPnWd^ezsjBoundsdBoundedlBoolockbeȀdπi)oۀndeadmv ar Exceptionn0d7e>fEiLnSiZtaehloyv Exceptionuffering BufferModetԁsہBitsbcdlpn\prssyn&c-e4x;cBeIpPtWi^oenlAsyncExceptionertionfaiÂlʂeтd؂ Exceptiong-iȄraHow Arrowaclmp`z8e?rFoM ArrowZerolgunsu ArrowPlusonad ArrowMonadooƃp̓ ArrowLoophoice ArrowChoicepp&l-y4 ArrowApplyyOArray#ehxocve}ptionArrayExceptionArray#tτhքe݄xceptionArithExceptiondgo9r@dGeNrUArgOrderensuc|rArgDescrpelicatąi˅v҅eم Applicativendh)modeIOModea0n7d>lEeL HandleTypeycAnyg7l*rӆternative Alternativeeچadyexis ts IOErrorTypeAllc^rCeJpQDataRepoenlsstzr ConstrRepdr#Addr#yc‡lɇiЇcׇsއccSCCsol utes&e-e4k;SeekMode:a]U[]:h]o[::]*+::+:::*:)()Ȉޖ\ԕΔz\“0wlkDBoolwtkc@?;3+*!IntuA4,IntSet xvlhVUaGB5-bIntSetBoolIntSet(,,)jIntIntArray IntSetInt(,)pIntSetIntSet(,)iak(,)dakMap!eQKJI" ak2MapbkMapckMapckMapa(,)Int[]IntArrayaSeta(,)8cIntMapa(,)Char[] q^]\TC<%Int[]r IntmaIntMapnmaPHaSeq zyogW60/aSet |ZYXS:9aTreeaViewL{1aViewR72a[]RF=&ambbIntMapbSetkSet#k[]'vertexSCC[vertex[].akMapak(,)(,)akMapakMap(,)ckMapbkMap(,) akMapaMaybeakMap(,,)IntInt(,)[] IntSetInt(,)msaInt(,)[]ak(,)[]$akMapa(,)m)IntMaybekeykey[]keynode(,,)IntInt[]IntArray(,,)M key[]keynode(,,)IntInt[]IntArray(,)LaSeta(,)m>aSetBoolaSet(,,)~akMapaMaybe(,)aIntMapaMaybeaIntMap(,,)`aIntMapaIntMap(,)_aIntMapaMaybe(,)aSeqaSeq(,)faSetaSet(,)}cIntMapbIntMap(,)VertexTree[] aTree[]DaTreema[][]EnodeSCC[]Okey[]keynode(,,)SCC[]NakMapak(,)(,)m(aIntMapaInt(,)(,)mVertex[]Tree[] aTree[]m©ΨTםI$!XK IaaaIntaaakabaIntbbaIntbbakcbakca(,)bIntaca(,)bkaaMaybebaIntaMaybebak BoolaIntBoolakBoolbaaaIntaaa aakababaIntbakbbIntbbacbaca(,)bacbEitheraIntcbEitherakChar[]akaMaybeaIntaMaybeakaMaybebabMaybeaIntbMaybeakBoolIntBoolaIntIntaabak2k1cbEitherab[]a(,)baMaybeabMaybeab[]a(,)mbaMaybeaMaybeBool^^]]\\Int!onmlkjihgfedcba`_5IntSetxxwwvutsrqplkji^a~}|{zyonm76bk-vertexIntInt(,)akMap@ed-,+*)('&%$#"!!  ak1MapbkMap"Int[]IntArray   Int[]UIntSet[]VaIntMap5ncba`_\aSeq{zogf765432100/aSet~}]BA@?>=<;;::98aTreeGFEDa[]ZYXWbIntMapb[]vertexSCC.vertex[][key[]keynode(,,)[]ONMLIntInt(,)[]aInt(,)[]Hak(,)[]KJIakMap[]QChar[]TreeCStringTree[]TaIntMap[]PaSCC[]RaSet[]SaTree[]}rg\Q4#ڻgOD0޺Ӻyj[J0 ٹιùyn]RG<1&Ѹs\Q@5&ʷ~^K8-ԶɶnUC4%ֵ˵}n_TE3 ܴʹyhS>, ٳveZI>3( ݲβ{l]N?0% ڱϱudUF7,ܰ˰yncXA6+ կʯhQ@1&Ю|kVK:/Ordk2Ordkc:OrdkOrdkOrdkyOrdklEqk&OrdkOrdkQOrdkOrdkStringOrdk6Ordk,Ordk*04OrdkMonadmMonadmForestForestOrdka`^Ordk8Ordk7OrdaOrdbOrdk2OrdkKey"Ordk!wOrdkjEqkivKey$Ordk#OrdkKey-1KeyOOrdaOrdaNOrdkOrdkLOrdk(Ordk'Key.2Ordk_bKeyKey9KeyKeyKeyKeykxKey%KeyKey/3KeyPKeyKeyKey5Key+KeyKeyMOrdkOrdkROrdkOrdkMonadmOrdkMonadmOrdk"OrdkOrdkOrdkZOrdkYKeyForestOrda#OrdaOrdaOrda  4+.SVMonadmB  String%()KeyKey!=$@KeyMonadmKey KeyKeyKeyStringShowaStringShowaStringuOrdahEqaptfnr;ForestString Orda]OrdkOrdkeyOrdkey{OrdkeyGraphVertex|OrdkeyGraphVertexsOrdkgEqkoemqKey[Forest<StringUX8OrdaMonadmD ShowaStringOrda6Orda-0'* ?~>< \ Ordk7OrdkMonadmMonadmCShowaShowkString 5OrdkEqaOrdkOrdk,/TW&)KeyMonadmKeyAKeyShowaString Key3EqaGraphVertexGraphVertex2ForestGraphVertex:GraphVertex1ForestGraphForestGraph?EdgeGraph}GraphTableGraphBoundsEdgeGraphFKJIHGEjZJ:*r`H0d6n<bJ2T:l> xJ0R. Z$X4 pT2gM!iGkG)eJ8`>$~`J6 rL pL*n>¿tS2"|>)|>?viewr<ViewR=viewr>viewl]ViewL;viewl<verticesvertices:vertexVertex9validvalid78 updatewithkeyԿ updateWithKey56updateminwithkeyupdateMinWithKey34 updatemin* updateMin12updatemaxwithkeySupdateMaxWithKey/0 updatemax| updateMax-.updatelookupwithkeyupdateLookupWithKey+,updateatupdateAt*updateupdate'() unionwithkey unionWithKey%& unionwith8 unionWith#$ unionswith[ unionsWith!"unions{unions unionunionunfoldtreem_bfunfoldTreeM_BF unfoldtreem unfoldTreeM unfoldtree unfoldTreeunfoldforestm_bf5unfoldForestM_BF unfoldforestm^ unfoldForestM unfoldforest unfoldForesttreeTree transposeg transposeGtopsorttopSorttolisttoList   toasclist toAscList   take?taketableTTable subforestn subForeststronglyconncomprstronglyConnCompRstronglyconncompstronglyConnComp splitmember splitMember splitlookup splitLookupsplitat0splitAtsplitHsplitsizeisize singleton singleton showtreewith showTreeWithshowtreeshowTreesetSetsequence)Sequenceseq@SeqsccRSCCscc rootlabels rootLabelreversereverse reachable reachablepathpathpartitionwithkeypartitionWithKey partition  partition outdegree7 outdegreenullPnull notmembery notMembernodeNodeminviewwithkeyminViewWithKeyminviewminViewmembermembermaxviewwithkey.maxViewWithKeymaxviewSmaxView mapwithkeyx mapWithKey mapmonotonic mapMonotonicmapmaybewithkeymapMaybeWithKeymapmaybemapMaybe mapkeyswith mapKeysWithmapkeysmonotonic6mapKeysMonotonicmapkeysYmapKeysmapeitherwithkey|mapEitherWithKey mapeither mapEithermapaccumwithkeymapAccumWithKeymapaccummapAccummapMapmap lookupindexB lookupIndexlookup_lookuplevels{levelslengthlengthkeyssetkeysSetkeyskeyskeyKey issubsetof isSubsetOf issubmapofby isSubmapOfBy issubmapofC isSubmapOfispropersubsetofmisProperSubsetOfispropersubmapofbyisProperSubmapOfByispropersubmapofisProperSubmapOfintsetIntSetintmapIntMapintersectionwithkey<intersectionWithKeyintersectionwithointersectionWith intersection intersectioninsertwithkey'insertWithKey' insertwithkey insertWithKey insertwith' insertWith' insertwith= insertWithinsertlookupwithkeyjinsertLookupWithKeyinsertinsertindexindex~indegreeindegree}graphfromedges'graphFromEdges'|graphfromedgesgraphFromEdges{graph:Graphzfromlistwithkey^fromListWithKeyxy fromlistwith fromListWithvwfromlistfromListqrstufromdistinctasclistfromDistinctAscListmnopfromasclistwithkey!fromAscListWithKeyklfromasclistwithRfromAscListWithij fromasclist| fromAscListefghforestForestd foldwithkey foldWithKeybcfoldfold^_`a flattensccs flattenSCCs] flattenscc) flattenSCC\flattenFflatten[findwithdefaulthfindWithDefaultYZfindminfindMinVWXfindmaxfindMaxSTU findindex findIndexR filterwithkey filterWithKeyPQfilterfilterLMNOemptyr=EmptyRKemptylUEmptyLJemptylemptyEFGHIelemselemsABCDelematelemAt@edgesedges?edgeEdge>dropdrop=drawtree drawTree< drawforest+ drawForest;differencewithkeyRdifferenceWithKey9:differencewithdifferenceWith78 difference difference3456dfsdfs2dffdff1 deletemin deleteMin./0 deletemax deleteMax+,- deletefindminH deleteFindMin()* deletefindmaxv deleteFindMax%&'deleteatdeleteAt$deletedelete !"# cyclicscc CyclicSCC containers containers components componentsbuildg;buildGboundsSBoundsbcchbccassocs}assocsalteralter adjustwithkey adjustWithKeyadjustadjust acyclicscc AcyclicSCC\\\\><1>< <|A<| :>Q:> :_>< <:$975F54 43T32s2+2H10/.,?+I'8$###""! !  %]N8EB   _   | A!x>!y9c(? Ei2N]4Oh|> (|>) :: Seq a -> a -> Seq aSeqaaSeqa|O(1). Add an element to the right end of a sequence. Mnemonic: a triangle with the single element at the pointy end. viewrviewr :: Seq a -> ViewR aSeqaViewRa2O(1). Analyse the right end of a sequence. ViewRdata ViewR a&%View of the right end of a sequence. viewlviewl :: Seq a -> ViewL aSeqaViewLa1O(1). Analyse the left end of a sequence. ViewLdata ViewL a $View of the left end of a sequence. verticesvertices :: Graph -> [Vertex]~Graph[]VertexAll vertices of a graph. Vertextype Vertex = Int%Abstract representation of vertices. validvalid ::  Ord a => Set a -> BoolvYOrdaSetaBool:O(n). Test if the internal set structure is valid. validvalid ::  Ord k => Map k a -> BoolOrdkMapkaBool:O(n). Test if the internal map structure is valid.  updateWithKey  updateWithKey ::  Ord k => (k -> a -> Maybe a) -> k -> Map k a -> Map k a%OrdkkaMaybeakMapkaMapka%O(log n). The expression (updateWithKey f k map) updates the value x at k (if it is in the map). If (f k x) is Nothing, the element is deleted. If it is (Just y), the key k is bound to the new value y.  updateWithKey  updateWithKey :: (Key -> a -> Maybe a) -> Key -> IntMap a -> IntMap a KeyaMaybeaKeyIntMapaIntMapa!O(min(n,W)). The expression (update f k map) updates the value x at k (if it is in the map). If (f k x) is Nothing, the element is deleted. If it is (Just y), the key k is bound to the new value y. updateMinWithKeyupdateMinWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k akaMaybeaMapkaMapka6O(log n). Update the value at the minimal key. updateMinWithKeyupdateMinWithKey :: (Key -> a -> a) -> IntMap a -> IntMap aKeyaaIntMapaIntMapa6O(log n). Update the value at the minimal key.  updateMin updateMin :: (a -> Maybe a) -> Map k a -> Map k aZaMaybeaMapkaMapka6O(log n). Update the value at the minimal key.  updateMin updateMin :: (a -> a) -> IntMap a -> IntMap aJ%aaIntMapaIntMapa6O(log n). Update the value at the minimal key. updateMaxWithKeyupdateMaxWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a/kaMaybeaMapkaMapka6O(log n). Update the value at the maximal key. updateMaxWithKeyupdateMaxWithKey :: (Key -> a -> a) -> IntMap a -> IntMap a KeyaaIntMapaIntMapa6O(log n). Update the value at the maximal key.  updateMax updateMax :: (a -> Maybe a) -> Map k a -> Map k aaMaybeaMapkaMapka6O(log n). Update the value at the maximal key.  updateMax updateMax :: (a -> a) -> IntMap a -> IntMap awaaIntMapaIntMapa6O(log n). Update the value at the maximal key. updateLookupWithKey updateLookupWithKey ::  Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a, Map k a)wOrdkkaMaybeakMapka(,)MaybeaMapka$O(log n). Lookup and update. updateLookupWithKey updateLookupWithKey :: (Key -> a -> Maybe a) -> Key -> IntMap a -> (Maybe a, IntMap a)KeyaMaybeaKeyIntMapa(,)MaybeaIntMapa'O(min(n,W)). Lookup and update. updateAt updateAt :: (k -> a -> Maybe a) -> Int -> Map k a -> Map k a}kaMaybeaIntMapkaMapkagO(log n). Update the element at index. Calls error when an invalid index is used. update update :: Int -> a -> Seq a -> Seq a}IntaSeqaSeqaIO(log(min(i,n-i))). Replace the element at the specified position update update ::  Ord k => (a -> Maybe a) -> k -> Map k a -> Map k a`OrdkaMaybeakMapkaMapkaO(log n). The expression (update f k map) updates the value x at k (if it is in the map). If (f x) is Nothing, the element is deleted. If it is (Just y), the key k is bound to the new value y. update update :: (a -> Maybe a) -> Key -> IntMap a -> IntMap a`-aMaybeaKeyIntMapaIntMapaO(min(n,W)). The expression (update f k map) updates the value x at k (if it is in the map). If (f x) is Nothing, the element is deleted. If it is (Just y), the key k is bound to the new value y.  unionWithKey  unionWithKey ::  Ord k => (k -> a -> a -> a) -> Map k a -> Map k a -> Map k aROrdkkaaaMapkaMapkaMapkaO(n+m). Union with a combining function. The implementation uses the efficient hedge-union algorithm. Hedge-union is more efficient on (bigset union smallset).  unionWithKey  unionWithKey :: (Key -> a -> a -> a) -> IntMap a -> IntMap a -> IntMap aKeyaaaIntMapaIntMapaIntMapa4O(n+m). The union with a combining function.  unionWith  unionWith ::  Ord k =>  (a -> a -> a) -> Map k a -> Map k a -> Map k aOrdkaaaMapkaMapkaMapkatO(n+m). Union with a combining function. The implementation uses the efficient hedge-union algorithm.  unionWith  unionWith ::  (a -> a -> a) -> IntMap a -> IntMap a -> IntMap aaaaIntMapaIntMapaIntMapa4O(n+m). The union with a combining function.  unionsWith unionsWith ::  Ord k =>  (a -> a -> a) ->  [Map k a] -> Map k aOrdkaaa[]MapkaMapkaThe union of a list of maps, with a combining operation: (unionsWith f == Prelude.foldl (unionWith f) empty).  unionsWith unionsWith ::  (a -> a -> a) ->  [IntMap a] -> IntMap aaaa[]IntMapaIntMapa8The union of a list of maps, with a combining operation unionsunions ::  Ord a => [Set a] -> Set aOrda[]SetaSetaaThe union of a list of sets: (unions == foldl union empty). unionsunions ::  Ord k =>  [Map k a] -> Map k aeOrdk[]MapkaMapkabThe union of a list of maps: (unions == Prelude.foldl union empty). unionsunions :: [IntSet] -> IntSetX?[]IntSetIntSetThe union of a list of sets. unionsunions ::  [IntMap a] -> IntMap a[]IntMapaIntMapa6O(log n). The expression (alter f k map) alters the value x at k, or absence thereof. alter can be used to insert, delete, or update a value in a Map. In short : lookup k (alter f k m) = f (lookup k m) The union of a list of maps. unionunion ::  Ord a => Set a -> Set a -> Set a|OrdaSetaSetaSetaO(n+m). The union of two sets, preferring the first set when equal elements are encountered. The implementation uses the efficient hedge-union algorithm. Hedge-union is more efficient on (bigset union smallset). unionunion ::  Ord k => Map k a -> Map k a -> Map k a)OrdkMapkaMapkaMapkawO(n+m). The expression (union t1 t2) takes the left-biased union of t1 and t2. It prefers t1 when duplicate keys are encountered, i.e. (union == unionWith const). The implementation uses the efficient hedge-union algorithm. Hedge-union is more efficient on (bigset union smallset) unionunion :: IntSet -> IntSet -> IntSetIntSetIntSetIntSet&O(n+m). The union of two sets. unionunion :: IntMap a -> IntMap a -> IntMap aIntMapaIntMapaIntMapaO(n+m). The (left-biased) union of two maps. It prefers the first map when duplicate keys are encountered, i.e. (union == unionWith const). unfoldTreeM_BFunfoldTreeM_BF ::  Monad m => (b -> m (a, [b])) -> b ->  m (Tree a)3Monadmbm(,)a[]bbmTreeaMonadic tree builder, in breadth-first order, using an algorithm adapted from Breadth-First Numbering: Lessons from a Small Exercise in Algorithm Design, by Chris Okasaki, ICFP'00.  unfoldTreeM unfoldTreeM ::  Monad m => (b -> m (a, [b])) -> b ->  m (Tree a)pMonadmbm(,)a[]bbmTreea+Monadic tree builder, in depth-first order  unfoldTree unfoldTree :: (b -> (a, [b])) -> b -> Tree ajAb(,)a[]bbTreeaBuild a tree from a seed value unfoldForestM_BFunfoldForestM_BF ::  Monad m => (b -> m (a, [b])) -> [b] ->  m (Forest a)XMonadmbm(,)a[]b[]bmForestaMonadic forest builder, in breadth-first order, using an algorithm adapted from Breadth-First Numbering: Lessons from a Small Exercise in Algorithm Design, by Chris Okasaki, ICFP'00.  unfoldForestM unfoldForestM ::  Monad m => (b -> m (a, [b])) -> [b] ->  m (Forest a)Monadmbm(,)a[]b[]bmForesta-Monadic forest builder, in depth-first order  unfoldForest unfoldForest :: (b -> (a, [b])) -> [b] -> Forest ab(,)a[]b[]bForesta*Build a forest from a list of seed values Treedata Tree a 2Multi-way trees, also known as rose trees.  transposeG transposeG :: Graph -> GraphGraphGraph+The graph obtained by reversing all edges. topSorttopSort :: Graph -> [Vertex],Graph[]VertexA topological sort of the graph. The order is partially specified by the condition that a vertex i precedes j whenever j is reachable from i but not vice versa. toListtoList :: Set a -> [a]D . Seta[]a4O(n). Convert the set to a list of elements. toListtoList :: Map k a -> [(k, a)]  Mapka[](,)ka3O(n). Convert to a list of key/value pairs. toListtoList :: IntSet -> [Int]x b IntSet[]Int4O(n). Convert the set to a list of elements. toListtoList :: IntMap a ->  [(Key, a)]  IntMapa[](,)Keya;O(n). Convert the map to a list of key/value pairs.  toAscList toAscList :: Set a -> [a]  Seta[]a?O(n). Convert the set to an ascending list of elements.  toAscList toAscList :: Map k a -> [(k, a)]p M Mapka[](,)ka+O(n). Convert to an ascending list.  toAscList toAscList :: IntSet -> [Int]  IntSet[]Int?O(n). Convert the set to an ascending list of elements.  toAscList toAscList :: IntMap a ->  [(Key, a)]  IntMapa[](,)KeyaaO(n). Convert the map to a list of key/value pairs where the keys are in ascending order. taketake :: Int -> Seq a -> Seq akIntSeqaSeqaHO(log(min(i,n-i))). The first i elements of a sequence. Tabletype Table a = Array Vertex a/Table indexed by a contiguous set of vertices.  subForest subForest :: Tree a -> Forest aTreeaForestazero or more child trees stronglyConnCompRstronglyConnCompR ::  Ord key => [(node, key, [key])] -> [SCC (node, key, [key])]POrdkey[](,,)nodekey[]key[]SCC(,,)nodekey[]keyTThe strongly connected components of a directed graph, topologically sorted. The function is the same as stronglyConnComp, except that all the information about each node retained. This interface is used when you expect to apply SCC to (some of) the result of SCC, so you don't want to lose the dependency information. stronglyConnCompstronglyConnComp ::  Ord key => [(node, key, [key])] ->  [SCC node]|Ordkey[](,,)nodekey[]key[]SCCnodeMThe strongly connected components of a directed graph, topologically sorted.  splitMember splitMember ::  Ord a => a -> Set a -> (Set a, Bool, Set a)OrdaaSeta(,,)SetaBoolSetasO(log n). Performs a split but also returns whether the pivot element was found in the original set.  splitMember splitMember :: Int -> IntSet -> (IntSet, Bool, IntSet)IntIntSet(,,)IntSetBoolIntSetvO(min(n,W)). Performs a split but also returns whether the pivot element was found in the original set.  splitLookup splitLookup ::  Ord k => k -> Map k a -> (Map k a, Maybe a, Map k a)OrdkkMapka(,,)MapkaMaybeaMapkaO(log n). The expression (splitLookup k map) splits a map just like split but also returns lookup k map.  splitLookup splitLookup :: Key -> IntMap a -> (IntMap a, Maybe a, IntMap a)i&KeyIntMapa(,,)IntMapaMaybeaIntMapaoO(log n). Performs a split but also returns whether the pivot key was found in the original map. splitAtsplitAt :: Int -> Seq a -> (Seq a, Seq a)f9IntSeqa(,)SeqaSeqaAO(log(min(i,n-i))). Split a sequence at a given position. splitsplit ::  Ord a => a -> Set a -> (Set a, Set a)@ OrdaaSeta(,)SetaSetaO(log n). The expression (split x set) is a pair (set1,set2) where all elements in set1 are lower than x and all elements in set2 larger than x. x is not found in neither set1 nor set2. splitsplit ::  Ord k => k -> Map k a -> (Map k a, Map k a)OrdkkMapka(,)MapkaMapka O(log n). The expression (split k map) is a pair (map1,map2) where the keys in map1 are smaller than k and the keys in map2 larger than k. Any key equal to k is found in neither map1 nor map2. splitsplit :: Int -> IntSet -> (IntSet, IntSet)IntIntSet(,)IntSetIntSet$O(min(n,W)). The expression (split x set) is a pair (set1,set2) where all elements in set1 are lower than x and all elements in set2 larger than x.
split 3 (fromList [1..5]) == (fromList [1,2], fromList [3,4])
splitsplit :: Key -> IntMap a -> (IntMap a, IntMap a)h2KeyIntMapa(,)IntMapaIntMapaO(log n). The expression (split k map) is a pair (map1,map2) where all keys in map1 are lower than k and all keys in map2 larger than k. Any key equal to k is found in neither map1 nor map2. sizesize :: Set a -> IntSetaInt0O(1). The number of elements in the set. sizesize :: Map k a -> Inta L MapkaInt0O(1). The number of elements in the map. sizesize :: IntSet -> Int  IntSetInt%O(n). Cardinality of the set. sizesize :: IntMap a -> Inta!L!IntMapaInt,O(n). Number of elements in the map.  singleton singleton :: a -> Set a!!aSeta%O(1). Create a singleton set.  singleton singleton :: a -> Seq ad"T"aSeqa#O(1). A singleton sequence.  singleton singleton :: k -> a -> Map k a""kaMapka*O(1). A map with a single element.  singleton singleton :: Int -> IntSet{#k#IntIntSet#O(1). A set of one element.  singleton singleton :: Key -> a -> IntMap a$#KeyaIntMapa#O(1). A map of one element.  showTreeWith  showTreeWith ::  Show a => Bool -> Bool -> Set a -> String$$ShowaBoolBoolSetaStringgO(n). The expression (showTreeWith hang wide map) shows the tree that implements the set. If hang is True, a hanging tree is shown otherwise a rotated tree is shown. If wide is True, an extra wide version is shown.
Set> putStrLn $ showTreeWith True False $ fromDistinctAscList [1..5]
4
+--2
|  +--1
|  +--3
+--5

Set> putStrLn $ showTreeWith True True $ fromDistinctAscList [1..5]
4
|
+--2
|  |
|  +--1
|  |
|  +--3
|
+--5

Set> putStrLn $ showTreeWith False True $ fromDistinctAscList [1..5]
+--5
|
4
|
|  +--3
|  |
+--2
   |
   +--1
 showTreeWith  showTreeWith :: (k -> a -> String) -> Bool -> Bool -> Map k a -> String ('kaStringBoolBoolMapkaString.O(n). The expression (showTreeWith showelem hang wide map) shows the tree that implements the map. Elements are shown using the showElem function. If hang is True, a hanging tree is shown otherwise a rotated tree is shown. If wide is True, an extra wide version is shown.
Map> let t = fromDistinctAscList [(x,()) | x <- [1..5]]
Map> putStrLn $ showTreeWith (\k x -> show (k,x)) True False t
(4,())
+--(2,())
|  +--(1,())
|  +--(3,())
+--(5,())

Map> putStrLn $ showTreeWith (\k x -> show (k,x)) True True t
(4,())
|
+--(2,())
|  |
|  +--(1,())
|  |
|  +--(3,())
|
+--(5,())

Map> putStrLn $ showTreeWith (\k x -> show (k,x)) False True t
+--(5,())
|
(4,())
|
|  +--(3,())
|  |
+--(2,())
   |
   +--(1,())
 showTreeWith  showTreeWith :: Bool -> Bool -> IntSet -> String++BoolBoolIntSetStringO(n). The expression (showTreeWith hang wide map) shows the tree that implements the set. If hang is True, a hanging tree is shown otherwise a rotated tree is shown. If wide is True, an extra wide version is shown.  showTreeWith  showTreeWith ::  Show a => Bool -> Bool -> IntMap a -> String-e-ShowaBoolBoolIntMapaStringO(n). The expression (showTreeWith hang wide map) shows the tree that implements the map. If hang is True, a hanging tree is shown otherwise a rotated tree is shown. If wide is True, an extra wide version is shown. showTreeshowTree ::  Show a => Set a -> String/.ShowaSetaStringgO(n). Show the tree that implements the set. The tree is shown in a compressed, hanging format. showTreeshowTree :: (Show k, Show a) => Map k a -> String0/ShowkShowaMapkaStringgO(n). Show the tree that implements the map. The tree is shown in a compressed, hanging format. showTreeshowTree :: IntSet -> String00IntSetStringgO(n). Show the tree that implements the set. The tree is shown in a compressed, hanging format. showTreeshowTree ::  Show a => IntMap a -> String11ShowaIntMapaStringgO(n). Show the tree that implements the map. The tree is shown in a compressed, hanging format. Setdata Set aS2A set of values a. Seqdata Seq a2"General-purpose finite sequences. sccscc :: Graph ->  Forest Vertex"33GraphForestVertex.The strongly connected components of a graph. SCCdata SCC vertex3Strongly connected component.  rootLabel rootLabel :: Tree a -> a33Treeaa label value reversereverse :: Seq a -> Seq af4O4SeqaSeqa(O(n). The reverse of a sequence.  reachable reachable :: Graph -> Vertex -> [Vertex]54GraphVertex[]Vertex2A list of vertices reachable from a given vertex. path path :: Graph -> Vertex -> Vertex -> Bool55GraphVertexVertexBool/Is the second vertex reachable from the first? partitionWithKeypartitionWithKey ::  Ord k => (k -> a -> Bool) -> Map k a -> (Map k a, Map k a)66OrdkkaBoolMapka(,)MapkaMapkaO(n). partition the map according to a predicate. The first map contains all elements that satisfy the predicate, the second all elements that fail the predicate. See also split. partitionWithKeypartitionWithKey :: (Key -> a -> Bool) -> IntMap a -> (IntMap a, IntMap a)\88KeyaBoolIntMapa(,)IntMapaIntMapaO(n). partition the map according to some predicate. The first map contains all elements that satisfy the predicate, the second all elements that fail the predicate. See also split.  partition partition ::  Ord a =>  (a -> Bool) -> Set a -> (Set a, Set a)99OrdaaBoolSeta(,)SetaSetaO(n). Partition the set into two sets, one with all elements that satisfy the predicate and one with all elements that don't satisfy the predicate. See also split.  partition partition ::  Ord k =>  (a -> Bool) -> Map k a -> (Map k a, Map k a)G;;OrdkaBoolMapka(,)MapkaMapkaO(n). partition the map according to a predicate. The first map contains all elements that satisfy the predicate, the second all elements that fail the predicate. See also split.  partition partition ::  (Int -> Bool) -> IntSet -> (IntSet, IntSet)<z<IntBoolIntSet(,)IntSetIntSet<O(n). partition the set according to some predicate.  partition partition ::  (a -> Bool) -> IntMap a -> (IntMap a, IntMap a)=[=aBoolIntMapa(,)IntMapaIntMapaO(n). partition the map according to some predicate. The first map contains all elements that satisfy the predicate, the second all elements that fail the predicate. See also split.  outdegree outdegree :: Graph ->  Table Int>>GraphTableInt.A table of the count of edges from each node. nullnull :: Set a -> BoolG?4?SetaBool$O(1). Is this the empty set? nullnull :: Seq a -> Bool??SeqaBool)O(1). Is this the empty sequence? nullnull :: Map k a -> BoolC@-@MapkaBoolO(1). Is the map empty? nullnull :: IntSet -> Bool@@IntSetBoolO(1). Is the set empty? nullnull :: IntMap a -> Bool0AAIntMapaBoolO(1). Is the map empty?  notMember notMember ::  Ord a => a -> Set a -> BoolAAOrdaaSetaBool0O(log n). Is the element not in the set?  notMember notMember ::  Ord k => k -> Map k a -> BoolBeBOrdkkMapkaBool5O(log n). Is the key not a member of the map?  notMember notMember :: Int -> IntSet -> Bool/CCIntIntSetBool3O(min(n,W)). Is the element not in the set?  notMember notMember :: Key -> IntMap a -> BoolCCKeyIntMapaBool5O(log n). Is the key not a member of the map? NodeNode :: a -> Forest a -> Tree aDdDaForestaTreeaminViewWithKeyminViewWithKey ::  Monad m => Map k a -> m ((k, a), Map k a)6EDMonadmMapkam(,)(,)kaMapkaO(log n). Retrieves the minimal (key,value) pair of the map, and the map stripped from that element fails (in the monad) when passed an empty map. minViewWithKeyminViewWithKey ::  Monad m => IntMap a -> m ((Key, a), IntMap a)FOFMonadmIntMapam(,)(,)KeyaIntMapaO(log n). Retrieves the minimal (key,value) couple of the map, and the map stripped from that element. fails (in the monad) when passed an empty map. minViewminView ::  Monad m => Set a ->  m (a, Set a)GGMonadmSetam(,)aSetaO(log n). Retrieves the minimal key of the set, and the set stripped from that element fails (in the monad) when passed an empty set. minViewminView ::  Monad m => Map k a -> m (a, Map k a)HHMonadmMapkam(,)aMapkaO(log n). Retrieves the minimal key's value of the map, and the map stripped from that element fails (in the monad) when passed an empty map. minViewminView ::  Monad m => IntSet -> m (Int, IntSet) JIMonadmIntSetm(,)IntIntSetO(min(n,W)). Retrieves the minimal key of the set, and the set stripped from that element fails (in the monad) when passed an empty set. membermember ::  Ord a => a -> Set a -> Bool5KKOrdaaSetaBool,O(log n). Is the element in the set? membermember ::  Ord k => k -> Map k a -> BoolKKOrdkkMapkaBool1O(log n). Is the key a member of the map? membermember :: Int -> IntSet -> BoolLiLIntIntSetBool6O(min(n,W)). Is the value a member of the set? membermember :: Key -> IntMap a -> Bool(M MKeyIntMapaBool4O(min(n,W)). Is the key a member of the map? maxViewWithKeymaxViewWithKey ::  Monad m => Map k a -> m ((k, a), Map k a)NMMonadmMapkam(,)(,)kaMapkaO(log n). Retrieves the maximal (key,value) pair of the map, and the map stripped from that element fails (in the monad) when passed an empty map. maxViewWithKeymaxViewWithKey ::  Monad m => IntMap a -> m ((Key, a), IntMap a)mO)OMonadmIntMapam(,)(,)KeyaIntMapaO(log n). Retrieves the maximal (key,value) couple of the map, and the map stripped from that element. fails (in the monad) when passed an empty map. maxViewmaxView ::  Monad m => Set a ->  m (a, Set a)PnPMonadmSetam(,)aSetaO(log n). Retrieves the maximal key of the set, and the set stripped from that element fails (in the monad) when passed an empty set. maxViewmaxView ::  Monad m => Map k a -> m (a, Map k a)QQMonadmMapkam(,)aMapkaO(log n). Retrieves the maximal key's value of the map, and the map stripped from that element fails (in the monad) when passed an empty map. maxViewmaxView ::  Monad m => IntSet -> m (Int, IntSet)RRMonadmIntSetm(,)IntIntSetO(min(n,W)). Retrieves the maximal key of the set, and the set stripped from that element fails (in the monad) when passed an empty set.  mapWithKey mapWithKey ::  (k -> a -> b) -> Map k a -> Map k b'TSkabMapkaMapkb8O(n). Map a function over all values in the map.  mapWithKey mapWithKey :: (Key -> a -> b) -> IntMap a -> IntMap bTTKeyabIntMapaIntMapb8O(n). Map a function over all values in the map.  mapMonotonic mapMonotonic :: (a -> b) -> Set a -> Set bUUabSetaSetbMO(n). The mapMonotonic f s == map f s, but works only when f is monotonic. The precondition is not checked. Semi-formally, we have:
and [x < y ==> f x < f y | x <- ls, y <- ls] 
                    ==> mapMonotonic f s == map f s
    where ls = toList s
mapMaybeWithKeymapMaybeWithKey ::  Ord k => (k -> a -> Maybe b) -> Map k a -> Map k bWWOrdkkaMaybebMapkaMapkbBO(n). Map keys/values and collect the Just results. mapMaybeWithKeymapMaybeWithKey :: (Key -> a -> Maybe b) -> IntMap a -> IntMap bXXKeyaMaybebIntMapaIntMapbBO(n). Map keys/values and collect the Just results. mapMaybemapMaybe ::  Ord k => (a -> Maybe b) -> Map k a -> Map k bYmYOrdkaMaybebMapkaMapkb=O(n). Map values and collect the Just results. mapMaybemapMaybe :: (a -> Maybe b) -> IntMap a -> IntMap b{ZMZaMaybebIntMapaIntMapb=O(n). Map values and collect the Just results.  mapKeysWith  mapKeysWith ::  Ord k2 =>  (a -> a -> a) ->  (k1 -> k2) -> Map k1 a -> Map k2 a[H[Ordk2aaak1k2Mapk1aMapk2a*O(n*log n). mapKeysWith c f s is the map obtained by applying f to each key of s. The size of the result may be smaller if f maps two or more distinct keys to the same new key. In this case the associated values will be combined using c. mapKeysMonotonicmapKeysMonotonic ::  (k1 -> k2) -> Map k1 a -> Map k2 aQ](]k1k2Mapk1aMapk2a_O(n). mapKeysMonotonic f s == mapKeys f s, but works only when f is strictly monotonic. The precondition is not checked. Semi-formally, we have:
and [x < y ==> f x < f y | x <- ls, y <- ls] 
                    ==> mapKeysMonotonic f s == mapKeys f s
    where ls = keys s
mapKeysmapKeys ::  Ord k2 =>  (k1 -> k2) -> Map k1 a -> Map k2 aS__Ordk2k1k2Mapk1aMapk2a O(n*log n). mapKeys f s is the map obtained by applying f to each key of s. The size of the result may be smaller if f maps two or more distinct keys to the same new key. In this case the value at the smallest of these keys is retained. mapEitherWithKeymapEitherWithKey ::  Ord k => (k -> a -> Either b c) -> Map k a -> (Map k b, Map k c)[aaOrdkkaEitherbcMapka(,)MapkbMapkcTO(n). Map keys/values and separate the Left and Right results. mapEitherWithKeymapEitherWithKey :: (Key -> a -> Either b c) -> IntMap a -> (IntMap b, IntMap c)b@bKeyaEitherbcIntMapa(,)IntMapbIntMapcTO(n). Map keys/values and separate the Left and Right results.  mapEither mapEither ::  Ord k => (a -> Either b c) -> Map k a -> (Map k b, Map k c)cacOrdkaEitherbcMapka(,)MapkbMapkcOO(n). Map values and separate the Left and Right results.  mapEither mapEither :: (a -> Either b c) -> IntMap a -> (IntMap b, IntMap c)d|daEitherbcIntMapa(,)IntMapbIntMapcOO(n). Map values and separate the Left and Right results. mapAccumWithKey mapAccumWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b ->  (a, Map k c)eeakb(,)acaMapkb(,)aMapkc~O(n). The function mapAccumWithKey threads an accumulating argument through the map in ascending order of keys. mapAccumWithKey mapAccumWithKey :: (a -> Key -> b -> (a, c)) -> a -> IntMap b ->  (a, IntMap c)=gfaKeyb(,)acaIntMapb(,)aIntMapcO(n). The function mapAccumWithKey threads an accumulating argument through the map in ascending order of keys. mapAccum mapAccum :: (a -> b -> (a, c)) -> a -> Map k b ->  (a, Map k c)hChab(,)acaMapkb(,)aMapkcwO(n). The function mapAccum threads an accumulating argument through the map in ascending order of keys. mapAccum mapAccum :: (a -> b -> (a, c)) -> a -> IntMap b ->  (a, IntMap c)iziab(,)acaIntMapb(,)aIntMapcO(n). The function mapAccum threads an accumulating argument through the map in ascending order of keys. mapmap :: (Ord a, Ord b) => (a -> b) -> Set a -> Set bjjOrdaOrdbabSetaSetbO(n*log n). map f s is the set obtained by applying f to each element of s. It's worth noting that the size of the result may be smaller if, for some (x,y), x /= y && f x == f y mapmap :: (a -> b) -> Map k a -> Map k bGl"labMapkaMapkb8O(n). Map a function over all values in the map. mapmap ::  (Int -> Int) -> IntSet -> IntSetllIntIntIntSetIntSetO(n*min(n,W)). map f s is the set obtained by applying f to each element of s. It's worth noting that the size of the result may be smaller if, for some (x,y), x /= y && f x == f y mapmap :: (a -> b) -> IntMap a -> IntMap brnMnabIntMapaIntMapb8O(n). Map a function over all values in the map. Mapdata Map k an1A Map from keys k to values a.  lookupIndex lookupIndex :: (Monad m, Ord k) => k -> Map k a -> m Into}oMonadmOrdkkMapkamIntO(log n). Lookup the index of a key. The index is a number from 0 up to, but not including, the size of the map. lookuplookup :: (Monad m, Ord k) => k -> Map k a -> m appMonadmOrdkkMapkamaO(log n). Lookup the value at a key in the map. The function will return the result in the monad or fail in it the key isn't in the map. Often, the monad to use is Maybe, so you get either (Just result) or Nothing. lookuplookup ::  Monad m => Key -> IntMap a -> m ayrPrMonadmKeyIntMapama:O(min(n,W)). Lookup the value at a key in the map. levelslevels :: Tree a -> [[a]]srTreea[][]a*Lists of nodes at each level of the tree. lengthlength :: Seq a -> IntssSeqaInt5O(1). The number of elements in the sequence. keysSetkeysSet :: Map k a -> Set k3ttMapkaSetk-O(n). The set of all keys of the map. keysSetkeysSet :: IntMap a -> IntSetttIntMapaIntSet6O(n*min(n,W)). The set of all keys of the map. keyskeys :: Map k a -> [k]Wu>uMapka[]k<O(n). Return all keys of the map in ascending order. keyskeys :: IntMap a -> [Key]uuIntMapa[]Key<O(n). Return all keys of the map in ascending order. Keytype Key = Intbv isSubsetOf isSubsetOf ::  Ord a => Set a -> Set a -> BoolvvOrdaSetaSetaBoolzO(n+m). Is this a subset? (s1 isSubsetOf s2) tells whether s1 is a subset of s2.  isSubsetOf isSubsetOf :: IntSet -> IntSet -> BoolwwIntSetIntSetBoolzO(n+m). Is this a subset? (s1 isSubsetOf s2) tells whether s1 is a subset of s2.  isSubmapOfBy  isSubmapOfBy ::  Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool&yxOrdkabBoolMapkaMapkbBoolO(n+m). The expression (isSubmapOfBy f t1 t2) returns True if all keys in t1 are in tree t2, and when f returns True when applied to their respective values. For example, the following expressions are all True:
isSubmapOfBy (==) (fromList [('a',1)]) (fromList [('a',1),('b',2)])
isSubmapOfBy (<=) (fromList [('a',1)]) (fromList [('a',1),('b',2)])
isSubmapOfBy (==) (fromList [('a',1),('b',2)]) (fromList [('a',1),('b',2)])
But the following are all False:
isSubmapOfBy (==) (fromList [('a',2)]) (fromList [('a',1),('b',2)])
isSubmapOfBy (<)  (fromList [('a',1)]) (fromList [('a',1),('b',2)])
isSubmapOfBy (==) (fromList [('a',1),('b',2)]) (fromList [('a',1)])
 isSubmapOfBy  isSubmapOfBy :: (a -> b -> Bool) -> IntMap a -> IntMap b -> Bool||abBoolIntMapaIntMapbBoolO(n+m). The expression (isSubmapOfBy f m1 m2) returns True if all keys in m1 are in m2, and when f returns True when applied to their respective values. For example, the following expressions are all True:
isSubmapOfBy (==) (fromList [(1,1)]) (fromList [(1,1),(2,2)])
isSubmapOfBy (<=) (fromList [(1,1)]) (fromList [(1,1),(2,2)])
isSubmapOfBy (==) (fromList [(1,1),(2,2)]) (fromList [(1,1),(2,2)])
But the following are all False:
isSubmapOfBy (==) (fromList [(1,2)]) (fromList [(1,1),(2,2)])
isSubmapOfBy (<) (fromList [(1,1)]) (fromList [(1,1),(2,2)])
isSubmapOfBy (==) (fromList [(1,1),(2,2)]) (fromList [(1,1)])
 isSubmapOf isSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Boold.OrdkEqaMapkaMapkaBooldO(n+m). This function is defined as (isSubmapOf = isSubmapOfBy (==)).  isSubmapOf isSubmapOf :: Eq a => IntMap a -> IntMap a -> Boola5EqaIntMapaIntMapaBooleO(n+m). Is this a submap? Defined as (isSubmapOf = isSubmapOfBy (==)). isProperSubsetOfisProperSubsetOf ::  Ord a => Set a -> Set a -> Boola:OrdaSetaSetaBoolFO(n+m). Is this a proper subset? (ie. a subset but not equal). isProperSubsetOfisProperSubsetOf :: IntSet -> IntSet -> Bool-IntSetIntSetBoolFO(n+m). Is this a proper subset? (ie. a subset but not equal). isProperSubmapOfBy isProperSubmapOfBy ::  Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> BoolF OrdkabBoolMapkaMapkbBool*O(n+m). Is this a proper submap? (ie. a submap but not equal). The expression (isProperSubmapOfBy f m1 m2) returns True when m1 and m2 are not equal, all keys in m1 are in m2, and when f returns True when applied to their respective values. For example, the following expressions are all True:
isProperSubmapOfBy (==) (fromList [(1,1)]) (fromList [(1,1),(2,2)])
isProperSubmapOfBy (<=) (fromList [(1,1)]) (fromList [(1,1),(2,2)])
But the following are all False:
isProperSubmapOfBy (==) (fromList [(1,1),(2,2)]) (fromList [(1,1),(2,2)])
isProperSubmapOfBy (==) (fromList [(1,1),(2,2)]) (fromList [(1,1)])
isProperSubmapOfBy (<)  (fromList [(1,1)])       (fromList [(1,1),(2,2)])
isProperSubmapOfBy isProperSubmapOfBy :: (a -> b -> Bool) -> IntMap a -> IntMap b -> Bool2abBoolIntMapaIntMapbBool*O(n+m). Is this a proper submap? (ie. a submap but not equal). The expression (isProperSubmapOfBy f m1 m2) returns True when m1 and m2 are not equal, all keys in m1 are in m2, and when f returns True when applied to their respective values. For example, the following expressions are all True:
isProperSubmapOfBy (==) (fromList [(1,1)]) (fromList [(1,1),(2,2)])
isProperSubmapOfBy (<=) (fromList [(1,1)]) (fromList [(1,1),(2,2)])
But the following are all False:
isProperSubmapOfBy (==) (fromList [(1,1),(2,2)]) (fromList [(1,1),(2,2)])
isProperSubmapOfBy (==) (fromList [(1,1),(2,2)]) (fromList [(1,1)])
isProperSubmapOfBy (<)  (fromList [(1,1)])       (fromList [(1,1),(2,2)])
isProperSubmapOfisProperSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool܋OrdkEqaMapkaMapkaBoolO(n+m). Is this a proper submap? (ie. a submap but not equal). Defined as (isProperSubmapOf = isProperSubmapOfBy (==)). isProperSubmapOfisProperSubmapOf :: Eq a => IntMap a -> IntMap a -> BoolM!EqaIntMapaIntMapaBoolO(log n). Retrieves the maximal key of the map, and the map stripped from that element. fails (in the monad) when passed an empty map. O(log n). Retrieves the minimal key of the map, and the map stripped from that element. fails (in the monad) when passed an empty map. O(log n). Delete and find the maximal element. O(log n). Delete and find the minimal element. O(log n). The minimal key of the map. O(log n). The maximal key of the map. O(log n). Delete the minimal key. O(log n). Delete the maximal key. O(n+m). Is this a proper submap? (ie. a submap but not equal). Defined as (isProperSubmapOf = isProperSubmapOfBy (==)). IntSetdata IntSetaA set of integers. IntMapdata IntMap a(A map of integers to values a. intersectionWithKey intersectionWithKey ::  Ord k => (k -> a -> b -> c) -> Map k a -> Map k b -> Map k cmOrdkkabcMapkaMapkbMapkcyO(n+m). Intersection with a combining function. Intersection is more efficient on (bigset intersection smallset) intersectionWithKey :: Ord k => (k -> a -> b -> c) -> Map k a -> Map k b -> Map k c intersectionWithKey f Tip t = Tip intersectionWithKey f t Tip = Tip intersectionWithKey f t1 t2 = intersectWithKey f t1 t2 intersectWithKey f Tip t = Tip intersectWithKey f t Tip = Tip intersectWithKey f t (Bin _ kx x l r) = case found of Nothing -> merge tl tr Just y -> join kx (f kx y x) tl tr where (lt,found,gt) = splitLookup kx t tl = intersectWithKey f lt l tr = intersectWithKey f gt r intersectionWithKey intersectionWithKey :: (Key -> a -> b -> a) -> IntMap a -> IntMap b -> IntMap aÔKeyabaIntMapaIntMapbIntMapa;O(n+m). The intersection with a combining function. intersectionWith intersectionWith ::  Ord k =>  (a -> b -> c) -> Map k a -> Map k b -> Map k c ̕OrdkabcMapkaMapkbMapkc7O(n+m). Intersection with a combining function. intersectionWith intersectionWith ::  (a -> b -> a) -> IntMap a -> IntMap b -> IntMap aЖabaIntMapaIntMapbIntMapa;O(n+m). The intersection with a combining function.  intersection intersection ::  Ord a => Set a -> Set a -> Set aؗOrdaSetaSetaSetaO(n+m). The intersection of two sets. Elements of the result come from the first set, so for example
import qualified Data.Set as S
data AB = A | B deriving Show
instance Ord AB where compare _ _ = EQ
instance Eq AB where _ == _ = True
main = print (S.singleton A `S.intersection` S.singleton B,
              S.singleton B `S.intersection` S.singleton A)
prints (fromList [A],fromList [B]).  intersection intersection ::  Ord k => Map k a -> Map k b -> Map k a&OrdkMapkaMapkbMapkaO(n+m). Intersection of two maps. The values in the first map are returned, i.e. (intersection m1 m2 == intersectionWith const m1 m2).  intersection intersection :: IntSet -> IntSet -> IntSetT9IntSetIntSetIntSet-O(n+m). The intersection of two sets.  intersection intersection :: IntMap a -> IntMap b -> IntMap aIntMapaIntMapbIntMapaKO(n+m). The (left-biased) intersection of two maps (based on keys). insertWithKey' insertWithKey' ::  Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a:OrdkkaaakaMapkaMapkaNSame as insertWithKey, but the combining function is applied strictly.  insertWithKey  insertWithKey ::  Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a]"OrdkkaaakaMapkaMapkafO(log n). Insert with a combining function. insertWithKey f key value mp will insert the pair (key, value) into mp if key does not exist in the map. If the key does exist, the function will insert the pair (key,f key new_value old_value). Note that the key passed to f is the same key passed to insertWithKey.  insertWithKey  insertWithKey :: (Key -> a -> a -> a) -> Key -> a -> IntMap a -> IntMap aZKeyaaaKeyaIntMapaIntMapa O(min(n,W)). Insert with a combining function. insertWithKey f key value mp will insert the pair (key, value) into mp if key does not exist in the map. If the key does exist, the function will insert f key new_value old_value.  insertWith'  insertWith' ::  Ord k =>  (a -> a -> a) -> k -> a -> Map k a -> Map k ad,OrdkaaakaMapkaMapkaKSame as insertWith, but the combining function is applied strictly.  insertWith  insertWith ::  Ord k =>  (a -> a -> a) -> k -> a -> Map k a -> Map k av>OrdkaaakaMapkaMapkaO(log n). Insert with a combining function. insertWith f key value mp will insert the pair (key, value) into mp if key does not exist in the map. If the key does exist, the function will insert the pair (key, f new_value old_value).  insertWith  insertWith ::  (a -> a -> a) -> Key -> a -> IntMap a -> IntMap aBaaaKeyaIntMapaIntMapaO(min(n,W)). Insert with a combining function. insertWith f key value mp will insert the pair (key, value) into mp if key does not exist in the map. If the key does exist, the function will insert f new_value old_value. insertLookupWithKey insertLookupWithKey ::  Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> (Maybe a, Map k a)FOrdkkaaakaMapka(,)MaybeaMapkaO(log n). The expression (insertLookupWithKey f k x map) is a pair where the first element is equal to (lookup k map) and the second element equal to (insertWithKey f k x map). insertLookupWithKey insertLookupWithKey :: (Key -> a -> a -> a) -> Key -> a -> IntMap a -> (Maybe a, IntMap a)$ܨKeyaaaKeyaIntMapa(,)MaybeaIntMapaO(min(n,W)). The expression (insertLookupWithKey f k x map) is a pair where the first element is equal to (lookup k map) and the second element equal to (insertWithKey f k x map). insertinsert ::  Ord a => a -> Set a -> Set alOrdaaSetaSetaO(log n). Insert an element in a set. If the set already contains an element equal to the given value, it is replaced with the new value. insert insert ::  Ord k => k -> a -> Map k a -> Map k aOrdkkaMapkaMapkaO(log n). Insert a new key and value in the map. If the key is already present in the map, the associated value is replaced with the supplied value, i.e. insert is equivalent to insertWith const. insertinsert :: Int -> IntSet -> IntSetIntIntSetIntSetO(min(n,W)). Add a value to the set. When the value is already an element of the set, it is replaced by the new one, ie. insert is left-biased. insert insert :: Key -> a -> IntMap a -> IntMap aAKeyaIntMapaIntMapaO(min(n,W)). Insert a new key/value pair in the map. If the key is already present in the map, the associated value is replaced with the supplied value, i.e. insert is equivalent to insertWith const. indexindex :: Seq a -> Int -> a~SeqaIntaAO(log(min(i,n-i))). The element at the specified position indegreeindegree :: Graph ->  Table Int;#GraphTableInt.A table of the count of edges into each node. graphFromEdges'graphFromEdges' ::  Ord key => [(node, key, [key])] -> %(Graph, Vertex -> (node, key, [key]))eOrdkey[](,,)nodekey[]key(,)GraphVertex(,,)nodekey[]keyIdentical to graphFromEdges, except that the return value does not include the function which maps keys to vertices. This version of graphFromEdges is for backwards compatibility. graphFromEdgesgraphFromEdges ::  Ord key => [(node, key, [key])] -> :(Graph, Vertex -> (node, key, [key]), key -> Maybe Vertex)OͲOrdkey[](,,)nodekey[]key(,,)GraphVertex(,,)nodekey[]keykeyMaybeVertexBuild a graph from a list of nodes uniquely identified by keys, with a list of keys of nodes this node should have edges to. The out-list may contain keys that don't correspond to nodes of the graph; they are ignored. Graphtype Graph = Table [Vertex]jYAdjacency list representation of a graph, mapping each vertex to its list of successors. fromListWithKeyfromListWithKey ::  Ord k => (k -> a -> a -> a) -> [(k, a)] -> Map k aHOrdkkaaa[](,)kaMapka}O(n*log n). Build a map from a list of key/value pairs with a combining function. See also fromAscListWithKey. fromListWithKeyfromListWithKey :: (Key -> a -> a -> a) ->  [(Key, a)] -> IntMap aKeyaaa[](,)KeyaIntMapazO(n*min(n,W)). Build a map from a list of key/value pairs with a combining function. See also fromAscListWithKey'.  fromListWith fromListWith ::  Ord k =>  (a -> a -> a) -> [(k, a)] -> Map k aOrdkaaa[](,)kaMapkazO(n*log n). Build a map from a list of key/value pairs with a combining function. See also fromAscListWith.  fromListWith fromListWith ::  (a -> a -> a) ->  [(Key, a)] -> IntMap aиaaa[](,)KeyaIntMapa~O(n*min(n,W)). Create a map from a list of key/value pairs with a combining function. See also fromAscListWith. fromListfromList ::  Ord a => [a] -> Set aйOrda[]aSeta9O(n*log n). Create a set from a list of elements. fromListfromList :: [a] -> Seq ar[]aSeqaO(n). Create a sequence from a finite list of elements. There is a function toList in the opposite direction for all instances of the Foldable class, including Seq. fromListfromList ::  Ord k => [(k, a)] -> Map k aϻOrdk[](,)kaMapka\O(n*log n). Build a map from a list of key/value pairs. See also fromAscList. fromListfromList :: [Int] -> IntSetw[]IntIntSet<O(n*min(n,W)). Create a set from a list of integers. fromListfromList ::  [(Key, a)] -> IntMap aA[](,)KeyaIntMapaCO(n*min(n,W)). Create a map from a list of key/value pairs. fromDistinctAscListfromDistinctAscList :: [a] -> Set a[]aSetaO(n). Build a set from an ascending list of distinct elements in linear time. The precondition (input list is strictly ascending) is not checked. fromDistinctAscListfromDistinctAscList :: [(k, a)] -> Map k a"[](,)kaMapka}O(n). Build a map from an ascending list of distinct elements in linear time. The precondition is not checked. fromDistinctAscListfromDistinctAscList :: [Int] -> IntSet[]IntIntSetOO(n*min(n,W)). Build a set from an ascending list of distinct elements. fromDistinctAscListfromDistinctAscList ::  [(Key, a)] -> IntMap a[](,)KeyaIntMapayO(n*min(n,W)). Build a map from a list of key/value pairs where the keys are in ascending order and all distinct. fromAscListWithKeyfromAscListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> Map k a1Eqkkaaa[](,)kaMapkaO(n). Build a map from an ascending list in linear time with a combining function for equal keys. The precondition (input list is ascending) is not checked. fromAscListWithKeyfromAscListWithKey :: (Key -> a -> a -> a) ->  [(Key, a)] -> IntMap acKeyaaa[](,)KeyaIntMapaO(n*min(n,W)). Build a map from a list of key/value pairs where the keys are in ascending order, with a combining function on equal keys. fromAscListWithfromAscListWith :: Eq k =>  (a -> a -> a) -> [(k, a)] -> Map k aEqkaaa[](,)kaMapkaO(n). Build a map from an ascending list in linear time with a combining function for equal keys. The precondition (input list is ascending) is not checked. fromAscListWithfromAscListWith ::  (a -> a -> a) ->  [(Key, a)] -> IntMap a4aaa[](,)KeyaIntMapaO(n*min(n,W)). Build a map from a list of key/value pairs where the keys are in ascending order, with a combining function on equal keys.  fromAscList fromAscList :: Eq a => [a] -> Set a;Eqa[]aSetaO(n). Build a set from an ascending list in linear time. The precondition (input list is ascending) is not checked.  fromAscList fromAscList :: Eq k => [(k, a)] -> Map k aGEqk[](,)kaMapkaO(n). Build a map from an ascending list in linear time. The precondition (input list is ascending) is not checked.  fromAscList fromAscList :: [Int] -> IntSet1[]IntIntSetFO(n*min(n,W)). Build a set from an ascending list of elements.  fromAscList fromAscList ::  [(Key, a)] -> IntMap a[](,)KeyaIntMapahO(n*min(n,W)). Build a map from a list of key/value pairs where the keys are in ascending order. Foresttype Forest a = [Tree a] foldWithKey  foldWithKey :: (k -> a -> b -> b) -> b -> Map k a -> b:kabbbMapkabO(n). Fold the keys and values in the map, such that foldWithKey f z == Prelude.foldr (uncurry f) z . toAscList. For example,
keys map = foldWithKey (\k x ks -> k:ks) [] map
 foldWithKey  foldWithKey :: (Key -> a -> b -> b) -> b -> IntMap a -> bKeyabbbIntMapabO(n). Fold the keys and values in the map, such that foldWithKey f z == Prelude.foldr (uncurry f) z . toAscList. For example,
keys map = foldWithKey (\k x ks -> k:ks) [] map
fold fold ::  (a -> b -> b) -> b -> Set a -> b( abbbSetabFO(n). Fold over the elements of a set in an unspecified order. fold fold ::  (a -> b -> b) -> b -> Map k a -> babbbMapkabO(n). Fold the values in the map, such that fold f z == Prelude.foldr f z . elems. For example,
elems map = fold (:) [] map
fold fold :: (Int -> b -> b) -> b -> IntSet -> b$IntbbbIntSetbO(n). Fold over the elements of a set in an unspecified order.
sum set   == fold (+) 0 set
elems set == fold (:) [] set
fold fold ::  (a -> b -> b) -> b -> IntMap a -> b:abbbIntMapabO(n). Fold the values in the map, such that fold f z == Prelude.foldr f z . elems. For example,
elems map = fold (:) [] map
 flattenSCCs flattenSCCs :: [SCC a] -> [a]O3[]SCCa[]a9The vertices of a list of strongly connected components.  flattenSCC flattenSCC ::  SCC vertex -> [vertex]SCCvertex[]vertex0The vertices of a strongly connected component. flattenflatten :: Tree a -> [a]wTreea[]a%The elements of a tree in pre-order. findWithDefault findWithDefault ::  Ord k => a -> k -> Map k a -> aP-OrdkakMapkaaO(log n). The expression (findWithDefault def k map) returns the value at key k or returns def when the key is not in the map. findWithDefault findWithDefault :: a -> Key -> IntMap a -> alaKeyIntMapaaO(min(n,W)). The expression (findWithDefault def k map) returns the value at key k or returns def when the key is not an element of the map. findMinfindMin :: Set a -> aSetaa/O(log n). The minimal element of a set. findMinfindMin :: Map k a -> (k, a)* Mapka(,)ka-O(log n). The minimal key of the map. findMinfindMin :: IntSet -> IntIntSetInt2O(min(n,W)). The minimal element of a set. findMaxfindMax :: Set a -> a6&Setaa/O(log n). The maximal element of a set. findMaxfindMax :: Map k a -> (k, a)Mapka(,)ka-O(log n). The maximal key of the map. findMaxfindMax :: IntSet -> IntSCIntSetInt2O(min(n,W)). The maximal element of a set.  findIndex findIndex ::  Ord k => k -> Map k a -> Int OrdkkMapkaIntO(log n). Return the index of a key. The index is a number from 0 up to, but not including, the size of the map. Calls error when the key is not a member of the map.  filterWithKey filterWithKey ::  Ord k => (k -> a -> Bool) -> Map k a -> Map k aXOrdkkaBoolMapkaMapka@O(n). Filter all keys/values that satisfy the predicate.  filterWithKey filterWithKey :: (Key -> a -> Bool) -> IntMap a -> IntMap asFKeyaBoolIntMapaIntMapaAO(n). Filter all keys/values that satisfy some predicate. filterfilter ::  Ord a =>  (a -> Bool) -> Set a -> Set aGOrdaaBoolSetaSeta=O(n). Filter all elements that satisfy the predicate. filterfilter ::  Ord k =>  (a -> Bool) -> Map k a -> Map k a!OrdkaBoolMapkaMapka;O(n). Filter all values that satisfy the predicate. filterfilter ::  (Int -> Bool) -> IntSet -> IntSetIntBoolIntSetIntSet>O(n). Filter all elements that satisfy some predicate. filterfilter ::  (a -> Bool) -> IntMap a -> IntMap aaBoolIntMapaIntMapa<O(n). Filter all values that satisfy some predicate. EmptyREmptyR :: ViewR a)ViewRaempty sequence EmptyLEmptyL :: ViewL a}pViewLaempty sequence emptyempty :: Set aSetaO(1). The empty set. emptyempty :: Seq a&Seqa!O(1). The empty sequence. emptyempty :: Map k a}MapkaO(1). The empty map. emptyempty :: IntSetIntSetO(1). The empty set. emptyempty :: IntMap aF8IntMapaO(1). The empty map. elemselems :: Set a -> [a]Seta[]a$O(n). The elements of a set. elemselems :: Map k a -> [a]=$Mapka[]aRO(n). Return all elements of the map in the ascending order of their keys. elemselems :: IntSet -> [Int]IntSet[]IntMO(n). The elements of a set. (For sets, this is equivalent to toList) elemselems :: IntMap a -> [a]~IntMapa[]aRO(n). Return all elements of the map in the ascending order of their keys. elemAtelemAt :: Int -> Map k a -> (k, a)dBIntMapka(,)kahO(log n). Retrieve an element by index. Calls error when an invalid index is used. edgesedges :: Graph -> [Edge](Graph[]EdgeAll edges of a graph. Edgetype Edge = (Vertex, Vertex)-An edge from the first vertex to the second. dropdrop :: Int -> Seq a -> Seq aIntSeqaSeqaNO(log(min(i,n-i))). Elements of a sequence after the first i. drawTreedrawTree ::  Tree String -> StringTreeStringString&Neat 2-dimensional drawing of a tree.  drawForest drawForest ::  Forest String -> StringpSForestStringString(Neat 2-dimensional drawing of a forest. differenceWithKey differenceWithKey ::  Ord k => (k -> a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a9OrdkkabMaybeaMapkaMapkbMapkaO(n+m). Difference with a combining function. When two equal keys are encountered, the combining function is applied to the key and both values. If it returns Nothing, the element is discarded (proper set difference). If it returns (Just y), the element is updated with a new value y. The implementation uses an efficient hedge algorithm comparable with hedge-union. differenceWithKey differenceWithKey :: (Key -> a -> b -> Maybe a) -> IntMap a -> IntMap b -> IntMap aKeyabMaybeaIntMapaIntMapbIntMapaDO(n+m). Difference with a combining function. When two equal keys are encountered, the combining function is applied to the key and both values. If it returns Nothing, the element is discarded (proper set difference). If it returns (Just y), the element is updated with a new value y. differenceWith differenceWith ::  Ord k => (a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a*OrdkabMaybeaMapkaMapkbMapkaO(n+m). Difference with a combining function. The implementation uses an efficient hedge algorithm comparable with hedge-union. differenceWith differenceWith :: (a -> b -> Maybe a) -> IntMap a -> IntMap b -> IntMap aOabMaybeaIntMapaIntMapbIntMapa5O(n+m). Difference with a combining function.  difference difference ::  Ord a => Set a -> Set a -> Set aV+OrdaSetaSetaSetaO(n+m). Difference of two sets. The implementation uses an efficient hedge algorithm comparable with hedge-union.  difference difference ::  Ord k => Map k a -> Map k b -> Map k aLOrdkMapkaMapkbMapkaO(n+m). Difference of two maps. The implementation uses an efficient hedge algorithm comparable with hedge-union.  difference difference :: IntSet -> IntSet -> IntSetjIntSetIntSetIntSet,O(n+m). Difference between two sets.  difference difference :: IntMap a -> IntMap b -> IntMap aDIntMapaIntMapbIntMapa<O(n+m). Difference between two maps (based on keys). dfsdfs :: Graph -> [Vertex] ->  Forest VertexGraph[]VertexForestVertexA spanning forest of the part of the graph reachable from the listed vertices, obtained from a depth-first search of the graph starting at each of the listed vertices in order. dffdff :: Graph ->  Forest VertexGraphForestVertexA spanning forest of the graph, obtained from a depth-first search of the graph starting from each vertex in an unspecified order.  deleteMin deleteMin :: Set a -> Set aSetaSeta-O(log n). Delete the minimal element.  deleteMin deleteMin :: Map k a -> Map k aMapkaMapka)O(log n). Delete the minimal key.  deleteMin deleteMin :: IntSet -> IntSet*IntSetIntSet0O(min(n,W)). Delete the minimal element.  deleteMax deleteMax :: Set a -> Set aSetaSeta-O(log n). Delete the maximal element.  deleteMax deleteMax :: Map k a -> Map k aY<MapkaMapka)O(log n). Delete the maximal key.  deleteMax deleteMax :: IntSet -> IntSetIntSetIntSet0O(min(n,W)). Delete the maximal element.  deleteFindMin deleteFindMin :: Set a ->  (a, Set a)nSeta(,)aSetauO(log n). Delete and find the minimal element.
deleteFindMin set = (findMin set, deleteMin set)
 deleteFindMin deleteFindMin :: Map k a -> ((k, a), Map k a)gMapka(,)(,)kaMapka6O(log n). Delete and find the minimal element.  deleteFindMin deleteFindMin :: IntSet ->  (Int, IntSet)K,IntSet(,)IntIntSetxO(min(n,W)). Delete and find the minimal element.
deleteFindMin set = (findMin set, deleteMin set)
 deleteFindMax deleteFindMax :: Set a ->  (a, Set a)>Seta(,)aSetauO(log n). Delete and find the maximal element.
deleteFindMax set = (findMax set, deleteMax set)
 deleteFindMax deleteFindMax :: Map k a -> ((k, a), Map k a)GMapka(,)(,)kaMapka6O(log n). Delete and find the maximal element.  deleteFindMax deleteFindMax :: IntSet ->  (Int, IntSet)IntSet(,)IntIntSetxO(min(n,W)). Delete and find the maximal element.
deleteFindMax set = (findMax set, deleteMax set)
deleteAtdeleteAt :: Int -> Map k a -> Map k aIntMapkaMapkaO(log n). Delete the element at index. Defined as (deleteAt i map = updateAt (k x -> Nothing) i map). deletedelete ::  Ord a => a -> Set a -> Set aOrdaaSetaSeta/O(log n). Delete an element from a set. deletedelete ::  Ord k => k -> Map k a -> Map k aOrdkkMapkaMapkaO(log n). Delete a key and its value from the map. When the key is not a member of the map, the original map is returned. deletedelete :: Int -> IntSet -> IntSetIntIntSetIntSethO(min(n,W)). Delete a value in the set. Returns the original set when the value was not present. deletedelete :: Key -> IntMap a -> IntMap awKeyIntMapaIntMapaO(min(n,W)). Delete a key and its value from the map. When the key is not a member of the map, the original map is returned.  CyclicSCC CyclicSCC :: [vertex] ->  SCC vertexr[]vertexSCCvertex.A maximal set of mutually reachable vertices.  components components :: Graph ->  Forest Vertex3GraphForestVertexThe connected components of a graph. Two vertices are connected if there is a path between them, traversing edges in either direction. buildGbuildG :: Bounds -> [Edge] -> Graph2Bounds[]EdgeGraph$Build a graph from a list of edges. Boundstype Bounds = (Vertex, Vertex)The bounds of a Table. bccbcc :: Graph -> Forest [Vertex]&GraphForest[]Vertex}The biconnected components of a graph. An undirected graph is biconnected if the deletion of any vertex leaves it connected. assocsassocs :: Map k a -> [(k, a)]Mapka[](,)kaKO(n). Return all key/value pairs in the map in ascending key order. assocsassocs :: IntMap a ->  [(Key, a)]IntMapa[](,)KeyaKO(n). Return all key/value pairs in the map in ascending key order. alter alter ::  Ord k => (Maybe a -> Maybe a) -> k -> Map k a -> Map k aOrdkMaybeaMaybeakMapkaMapkaO(log n). The expression (alter f k map) alters the value x at k, or absence thereof. alter can be used to insert, delete, or update a value in a Map. In short : lookup k (alter f k m) = f (lookup k m)  adjustWithKey  adjustWithKey ::  Ord k =>  (k -> a -> a) -> k -> Map k a -> Map k a  OrdkkaakMapkaMapkazO(log n). Adjust a value at a specific key. When the key is not a member of the map, the original map is returned.  adjustWithKey  adjustWithKey :: (Key -> a -> a) -> Key -> IntMap a -> IntMap a  KeyaaKeyIntMapaIntMapa}O(min(n,W)). Adjust a value at a specific key. When the key is not a member of the map, the original map is returned. adjust adjust :: (a -> a) -> Int -> Seq a -> Seq a  aaIntSeqaSeqaHO(log(min(i,n-i))). Update the element at the specified position adjust adjust ::  Ord k => (a -> a) -> k -> Map k a -> Map k a  OrdkaakMapkaMapkazO(log n). Adjust a value at a specific key. When the key is not a member of the map, the original map is returned. adjust adjust :: (a -> a) -> Key -> IntMap a -> IntMap aaaKeyIntMapaIntMapa}O(min(n,W)). Adjust a value at a specific key. When the key is not a member of the map, the original map is returned.  AcyclicSCC AcyclicSCC :: vertex ->  SCC vertexvertexSCCvertex*A single vertex that is not in any cycle. \\ (\\) ::  Ord a => Set a -> Set a -> Set alOrdaSetaSetaSeta&O(n+m). See difference. \\ (\\) ::  Ord k => Map k a -> Map k b -> Map k aV"OrdkMapkaMapkbMapka&O(n+m). See difference. \\ (\\) :: IntSet -> IntSet -> IntSetIntSetIntSetIntSet&O(n+m). See difference. \\ (\\) :: IntMap a -> IntMap b -> IntMap auIntMapaIntMapbIntMapa&O(n+m). See difference. >< (><) :: Seq a -> Seq a -> Seq a<SeqaSeqaSeqa6O(log(min(n1,n2))). Concatenate two sequences. <| (<|) :: a -> Seq a -> Seq aaSeqaSeqa{O(1). Add an element to the left end of a sequence. Mnemonic: a triangle with the single element at the pointy end. :> (:>) :: Seq a -> a -> ViewR aSeqaaViewRaDthe sequence minus the rightmost element, and the rightmost element :< (:<) :: a -> Seq a -> ViewL a}aaSeqaViewLa.leftmost element and the rest of the sequence ! (!) ::  Ord k => Map k a -> k -> a"OrdkMapkaka`O(log n). Find the value at a key. Calls error when the element can not be found. ! (!) :: IntMap a -> Key -> aIntMapaKeyacO(min(n,W)). Find the value at a key. Calls error when the element can not be found. Treemodule Data.Tree}5Multi-way trees (aka rose trees) and forests. Setmodule Data.SetAn efficient implementation of sets. Since many function names (but not the type name) clash with Prelude names, this module is usually imported qualified, e.g.
import Data.Set (Set)
import qualified Data.Set as Set
The implementation of Set is based on size balanced binary trees (or trees of bounded balance) as described by:
  • Stephen Adams, "Efficient sets: a balancing act", Journal of Functional Programming 3(4):553-562, October 1993, http://www.swiss.ai.mit.edu/~adams/BB/.
  • J. Nievergelt and E.M. Reingold, "Binary search trees of bounded balance", SIAM journal of computing 2(1), March 1973.
Note that the implementation is left-biased -- the elements of a first argument are always preferred to the second, for example in union or insert. Of course, left-biasing can only be observed when equality is an equivalence relation instead of structural equality. Sequencemodule Data.SequenceGeneral purpose finite sequences. Apart from being finite and having strict operations, sequences also differ from lists in supporting a wider variety of operations efficiently. An amortized running time is given for each operation, with n referring to the length of the sequence and i being the integral index used by some operations. These bounds hold even in a persistent (shared) setting. The implementation uses 2-3 finger trees annotated with sizes, as described in section 4.2 of Note: Many of these operations have the same names as similar operations on lists in the Prelude. The ambiguity may be resolved using either qualification or the hiding clause. Mapmodule Data.MapAn efficient implementation of maps from keys to values (dictionaries). Since many function names (but not the type name) clash with Prelude names, this module is usually imported qualified, e.g.
import Data.Map (Map)
import qualified Data.Map as Map
The implementation of Map is based on size balanced binary trees (or trees of bounded balance) as described by:
  • Stephen Adams, "Efficient sets: a balancing act", Journal of Functional Programming 3(4):553-562, October 1993, http://www.swiss.ai.mit.edu/~adams/BB/.
  • J. Nievergelt and E.M. Reingold, "Binary search trees of bounded balance", SIAM journal of computing 2(1), March 1973.
Note that the implementation is left-biased -- the elements of a first argument are always preferred to the second, for example in union or insert. IntSetmodule Data.IntSet#An efficient implementation of integer sets. Since many function names (but not the type name) clash with Prelude names, this module is usually imported qualified, e.g.
import Data.IntSet (IntSet)
import qualified Data.IntSet as IntSet
The implementation is based on big-endian patricia trees. This data structure performs especially well on binary operations like union and intersection. However, my benchmarks show that it is also (much) faster on insertions and deletions when compared to a generic size-balanced set implementation (see Data.Set).
  • Chris Okasaki and Andy Gill, "Fast Mergeable Integer Maps", Workshop on ML, September 1998, pages 77-86, http://citeseer.ist.psu.edu/okasaki98fast.html
  • D.R. Morrison, "/PATRICIA -- Practical Algorithm To Retrieve Information Coded In Alphanumeric/", Journal of the ACM, 15(4), October 1968, pages 514-534.
Many operations have a worst-case complexity of O(min(n,W)). This means that the operation can become linear in the number of elements with a maximum of W -- the number of bits in an Int (32 or 64). IntMapmodule Data.IntMap](An efficient implementation of maps from integer keys to values. Since many function names (but not the type name) clash with Prelude names, this module is usually imported qualified, e.g.
import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
The implementation is based on big-endian patricia trees. This data structure performs especially well on binary operations like union and intersection. However, my benchmarks show that it is also (much) faster on insertions and deletions when compared to a generic size-balanced map implementation (see Data.Map).
  • Chris Okasaki and Andy Gill, "Fast Mergeable Integer Maps", Workshop on ML, September 1998, pages 77-86, http://citeseer.ist.psu.edu/okasaki98fast.html
  • D.R. Morrison, "/PATRICIA -- Practical Algorithm To Retrieve Information Coded In Alphanumeric/", Journal of the ACM, 15(4), October 1968, pages 514-534.
Many operations have a worst-case complexity of O(min(n,W)). This means that the operation can become linear in the number of elements with a maximum of W -- the number of bits in an Int (32 or 64). Graphmodule Data.Graph@-A version of the graph algorithms described in: Lazy Depth-First Search and Linear Graph Algorithms in Haskell, by David King and John Launchbury. containerspackage  containers.Assorted concrete container types This package contains efficient general-purpose implementations of various basic immutable container types. The declared cost of each operation is either worst-case or amortized, but remains valid even if structures are shared. /v/i/\/R/H/9/DataSequenceDataSetDataMapDataIntSetDataIntMapDataTreeDataGraph/ containers0.1.0.1Hhttp://hackage.haskell.org/packages/archive/containers/0.1.0.1/doc/html/Ehttp://hackage.haskell.org/cgi-bin/hackage-scripts/package/containers