<div dir="auto">That's not the current representation of sequences, and making that change would be a significant project I can't undertake at the moment. I'm not proposing to freeze the sequence representation solid; just to bring it under PVP and make it more accessible/usable to other packages. I also want the (Int,+) finger trees for a currently-toy project playing with incremental quicksort for sequences.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 5, 2021, 7:07 PM Zemyla <<a href="mailto:zemyla@gmail.com">zemyla@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">I was sort of thinking of something similar, but what I would want to export would be constructors for it:<div dir="auto"><br></div><div dir="auto">data Seq a</div><div dir="auto">  = Empty</div><div dir="auto">  | Single a</div><div dir="auto">  | More {-# UNPACK #-} !(Seq2 a)</div><div dir="auto"><br></div><div dir="auto">where a Seq2 is basically the Deep constructor as a type, and represents a Seq with 2 or more values in it. Though I expect this won't happen until we start using dependent types to express the difference between possibly-empty and nonempty sequences.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 5, 2021, 15:22 David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank" rel="noreferrer">david.feuer@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'd like containers to export more Data.Sequence internals, and to do<br>
so in a way that allows external users to rely on them. I propose the<br>
following:<br>
<br>
1. Add a module, Data.FingerTree.IntPlus, abstractly exporting the<br>
finger trees used to represent sequences. These can also be used for<br>
other finger trees with measurements in the (Int, +) monoid. This<br>
would include various basic operations for cons, snoc, and splitting,<br>
with most names the same as for sequences.<br>
2. Add a module, Data.FingerTree.IntPlus.Unsafe, exporting efficient<br>
mapping/traversing functions that rely on specific preconditions to<br>
maintain the internal fingertree annotation invariant.<br>
3. Add a module, Data.Sequence.StableInternal, exporting the internal<br>
structure of sequences and also some internal functions that may be<br>
useful elsewhere (I'm particularly interested in the `splitMap`<br>
function and future variants thereof). Unlike the `.Internal` module,<br>
this module would be subject to the package version policy, and would<br>
therefore be more suitable for use by other packages.<br>
<br>
I am very open to suggestions for modifications to the module names.<br>
One option might be to put all the FingerTree.IntPlus stuff in the<br>
Data.Sequence.StableInternal hierarchy, if folks think it should be<br>
buried a bit.<br>
<br>
David<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" rel="noreferrer noreferrer" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>
</blockquote></div>