úÎ! [i"      !1(c) 2006-2009 Don Stewart, 2013-2016 Sean LeatherSee LICENSE filesean.leather@gmail.comstableportable Trustworthy%FTe¨dlist†A difference list is a function that, given a list, returns the original contents of the difference list prepended to the given list.This structure supports O(1)m append and snoc operations on lists, making it very useful for append-heavy uses (esp. left-nested uses of "(), such as logging and pretty printing.]Here is an example using DList as the state type when printing a tree with the Writer monad: ÿimport Control.Monad.Writer import Data.DList data Tree a = Leaf a | Branch (Tree a) (Tree a) flatten_writer :: Tree x -> DList x flatten_writer = snd . runWriter . flatten where flatten (Leaf x) = tell (singleton x) flatten (Branch x y) = flatten x >> flatten ydlist'A unidirectional pattern synonym using $ in a view pattern and matching on x:xs such that you have the pattern  Cons x xsdlist'A unidirectional pattern synonym using $ in a view pattern and matching on []dlistConvert a list to a dlistdlistConvert a dlist to a listdlistDApply a dlist to a list to get the underlying list with an extension !apply (fromList xs) ys = xs ++ ysdlist%Create a dlist containing no elementsdlist"Create dlist with a single elementdlistO(1)%. Prepend a single element to a dlist dlistO(1)$. Append a single element to a dlist dlistO(1). Append dlists dlistO(spine). Concatenate dlists dlistO(n)0. Create a dlist of the given number of elements dlistO(n). List elimination for dlistsdlistO(n). Return the head of the dlistdlistO(n). Return the tail of the dlistdlistO(n). Unfoldr for dlistsdlistO(n). Foldr over difference listsdlistO(n). Map over difference lists.    #      !"#$%&'#dlist-0.8.0.5-I6CwXwt8UvhK996Lp3Q3y Data.DListDListConsNilfromListtoListapplyempty singletonconssnocappendconcat replicatelistheadtailunfoldrfoldrmap$fSemigroupDList $fIsListDList$fIsStringDList $fNFDataDList$fFoldableDList$fMonadPlusDList $fMonadDList$fAlternativeDList$fApplicativeDList$fFunctorDList $fMonoidDList $fShowDList $fReadDList $fOrdDList $fEqDListbaseGHC.Base++