<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>If we're looking at things like this, have you seen the At, Cons
and Empty type-classes in lens?<br>
</p>
<div class="moz-cite-prefix">On 13/9/19 1:13 am, David Feuer wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAMgWh9vyNfzBLkModQotCJS+Wh+HEXNyyK-DUp5hHM0S04Y-uw@mail.gmail.com">
<div dir="auto">I think Michael Snoyman did a good job of starting
that conversation with his IsSequence class in mono-traversable.
I don't agree with a lot of the specific design decisions he's
made, but I think we should definitely think about previous
experience in that space.
<div dir="auto"><br>
</div>
<div dir="auto">Personally, I prefer an MPTC-based interface for
the monomorphic stuff. This is mostly a matter of taste, of
course. <span>One important idea, of course, is that of a free
monoid:</span></div>
<div dir="auto"><br>
</div>
<div dir="auto">type family Elem xs</div>
<div dir="auto"><br>
</div>
<div dir="auto">class e ~ Elem c => MonoFoldable e c where</div>
<div dir="auto"> mfoldMap :: Monoid m => (e -> m) -> c
-> m</div>
<div dir="auto"><br>
</div>
<div dir="auto">class (MonoFoldable e c, Monoid c) =>
MonoSequence e c where</div>
<div dir="auto"> mSingleton :: e -> c</div>
<div dir="auto"> -- All other methods can be optional</div>
<div dir="auto"><br>
</div>
<div dir="auto"><span>class (forall e. Monoid (t e)) =>
Monoid1 t</span><br>
</div>
<div dir="auto"><span>instance (forall e. Monoid (t e)) =>
Monoid1 t</span><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">class (Traversable t, Monoid1 t) => Sequence
t where</div>
<div dir="auto"> singleton :: e -> t e</div>
<div dir="auto"> -- All other methods can be optional</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Sep 12, 2019, 10:42 AM
Andreas Abel <<a href="mailto:andreas.abel@ifi.lmu.de"
moz-do-not-send="true">andreas.abel@ifi.lmu.de</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote">I think this proposal was be
stronger if it would lay out the bigger <br>
picture, i.e., directions towards a unified interface to
sequence-like <br>
collections.<br>
<br>
-1 in its current form.<br>
<br>
On 2019-09-11 16:32, Helmut Schmidt wrote:<br>
> Taylor,<br>
> <br>
> Is it really necessary for you to be so rude? I can
assure you that my <br>
> proposal has been made in the same good faith as your
proposal which <br>
> inspired mine.<br>
> <br>
> Besides that unnecessary snark you do make an excellent
point regarding <br>
> the poor discoverability of the list constructor which I
imagine must <br>
> cause a lot of confusion among newcomers.Thank you for
keeping an open mind!<br>
> <br>
> <br>
> <br>
> Am Mi., 11. Sept. 2019 um 11:21 Uhr schrieb Taylor Fausak
<br>
> <<a href="mailto:taylor@fausak.me" target="_blank"
rel="noreferrer" moz-do-not-send="true">taylor@fausak.me</a>
<mailto:<a href="mailto:taylor@fausak.me" target="_blank"
rel="noreferrer" moz-do-not-send="true">taylor@fausak.me</a>>>:<br>
> <br>
> I suspect this proposal was not made in good faith. I
feel like it<br>
> was meant to make fun of my list singleton proposal.<br>
> <br>
> In spite of that, I am in favor of this proposal. One
of the (very<br>
> minor!) problems with lists in Haskell is that they
can’t be<br>
> documented with Haddock because they’re part of the
syntax. For<br>
> example, if you search Hoogle for `(:)` or `a ->
[a] -> [a]` you<br>
> won’t find the venerable list constructor. You will
find `cons` from<br>
> the `extra` package, which I think suggests that this
proposal is a<br>
> good idea.<br>
> <br>
> +1<br>
> <br>
> > On Sep 11, 2019, at 4:13 AM, Oliver Charles<br>
> <<a href="mailto:ollie@ocharles.org.uk"
target="_blank" rel="noreferrer" moz-do-not-send="true">ollie@ocharles.org.uk</a>
<mailto:<a href="mailto:ollie@ocharles.org.uk"
target="_blank" rel="noreferrer" moz-do-not-send="true">ollie@ocharles.org.uk</a>>>
wrote:<br>
> ><br>
> > On Wed, Sep 11, 2019 at 7:36 AM Helmut Schmidt<br>
> > <<a
href="mailto:helmut.schmidt.4711@gmail.com" target="_blank"
rel="noreferrer" moz-do-not-send="true">helmut.schmidt.4711@gmail.com</a><br>
> <mailto:<a
href="mailto:helmut.schmidt.4711@gmail.com" target="_blank"
rel="noreferrer" moz-do-not-send="true">helmut.schmidt.4711@gmail.com</a>>>
wrote:<br>
> ><br>
> >> I can't be the only that wants this
function, right?<br>
> ><br>
> > You're not the only one! I would also like this
function. In fact,<br>
> > only yesterday I found myself writing<br>
> ><br>
> > ( x : ) <$> recurse xs<br>
> ><br>
> > I would have preferred<br>
> ><br>
> > cons x <$> recurse xs<br>
> ><br>
> > +1 to adding cons :: x -> [x] -> [x]
to Data.List.<br>
> ><br>
> > Ollie<br>
> > _______________________________________________<br>
> > Libraries mailing list<br>
> > <a href="mailto:Libraries@haskell.org"
target="_blank" rel="noreferrer" moz-do-not-send="true">Libraries@haskell.org</a>
<mailto:<a href="mailto:Libraries@haskell.org"
target="_blank" rel="noreferrer" moz-do-not-send="true">Libraries@haskell.org</a>><br>
> > <a
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
> <br>
> <br>
> _______________________________________________<br>
> Libraries mailing list<br>
> <a href="mailto:Libraries@haskell.org" target="_blank"
rel="noreferrer" moz-do-not-send="true">Libraries@haskell.org</a><br>
> <a
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
> <br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank"
rel="noreferrer" moz-do-not-send="true">Libraries@haskell.org</a><br>
<a
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Libraries mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libraries@haskell.org">Libraries@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a>
</pre>
</blockquote>
</body>
</html>