traverse_

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

traverse_

Herbert Valerio Riedel
On 2015-03-30 at 07:05:56 +0200, Fumiaki Kinoshita wrote:

[...]

> I found out that (<>) (in Data.Monoid) is missing, also. It would be nice
> to reexamine Prelude to export things we want to export.

Fwiw, (<>) was actually left-out as it wasn't required (it's just a an
alias for `mappend`), *and* to keep our options open (or at least not
make it more difficult) in terms of possible migration-plans available
for the case we'd be moving 'Semigroup' to base/Prelude at some point in
the future.


Reply | Threaded
Open this post in threaded view
|

traverse_

Fumiaki Kinoshita
Well, I see. It'd be nice.

That aside, the absence of traverse_ doesn't seem to be intended (even the
documentation for mapM_ says "mapM_ is just traverse_"!)

2015-03-30 16:54 GMT+09:00 Herbert Valerio Riedel <hvr at gnu.org>:

> On 2015-03-30 at 07:05:56 +0200, Fumiaki Kinoshita wrote:
>
> [...]
>
> > I found out that (<>) (in Data.Monoid) is missing, also. It would be nice
> > to reexamine Prelude to export things we want to export.
>
> Fwiw, (<>) was actually left-out as it wasn't required (it's just a an
> alias for `mappend`), *and* to keep our options open (or at least not
> make it more difficult) in terms of possible migration-plans available
> for the case we'd be moving 'Semigroup' to base/Prelude at some point in
> the future.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150331/c64ea682/attachment.html>

Reply | Threaded
Open this post in threaded view
|

traverse_

Herbert Valerio Riedel
On 2015-03-31 at 06:27:32 +0200, Chris Wong wrote:

[...]

> While it would be useful to have it in the Prelude, traverse_ doesn't
> fit either of the motivations above. So I think its omission is
> intended here.

That is not to say that it can't be proposed for inclusion... IOW, just
turn the cautious "'traverse_' is not exported from Prelude [..] Is this
intentional?"-question into an explicit/proper library proposal!

Cheers,
  hvr

Reply | Threaded
Open this post in threaded view
|

traverse_

Edward Kmett-2
In reply to this post by Fumiaki Kinoshita
We deliberately took no more symbols than we needed in 7.10 from Prelude as
part of the Foldable/Traversable Proposal. There are multiple combinators
in Data.Foldable and Data.Traversable that we do not export. traverse_ is
one of them as, strictly speaking, traverse_ was a symbol we didn't have to
take.

If we had would anybody have complained any more loudly? Not sure... but it
was a deliberate choice to not bring in any symbols into Prelude that
weren't already there that weren't part of the definition of a class or
needed to define instances that already existed.

-Edward

On Mon, Mar 30, 2015 at 11:33 PM, Fumiaki Kinoshita <fumiexcel at gmail.com>
wrote:

> Well, I see. It'd be nice.
>
> That aside, the absence of traverse_ doesn't seem to be intended (even the
> documentation for mapM_ says "mapM_ is just traverse_"!)
>
> 2015-03-30 16:54 GMT+09:00 Herbert Valerio Riedel <hvr at gnu.org>:
>
>> On 2015-03-30 at 07:05:56 +0200, Fumiaki Kinoshita wrote:
>>
>> [...]
>>
>> > I found out that (<>) (in Data.Monoid) is missing, also. It would be
>> nice
>> > to reexamine Prelude to export things we want to export.
>>
>> Fwiw, (<>) was actually left-out as it wasn't required (it's just a an
>> alias for `mappend`), *and* to keep our options open (or at least not
>> make it more difficult) in terms of possible migration-plans available
>> for the case we'd be moving 'Semigroup' to base/Prelude at some point in
>> the future.
>>
>>
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150331/ffa4bbcc/attachment.html>

Reply | Threaded
Open this post in threaded view
|

traverse_

Fumiaki Kinoshita
I understand the ground. It seems reasonable not to add symbols facilely.

But in this case, the "too specialized" version is exported while more
fundamental one is not.
Although folks (including me) use mapM_ mostly today, someday we will like
to have traverse_, I guess.

2015-03-31 19:41 GMT+09:00 Edward Kmett <ekmett at gmail.com>:

> We deliberately took no more symbols than we needed in 7.10 from Prelude
> as part of the Foldable/Traversable Proposal. There are multiple
> combinators in Data.Foldable and Data.Traversable that we do not export.
> traverse_ is one of them as, strictly speaking, traverse_ was a symbol we
> didn't have to take.
>
> If we had would anybody have complained any more loudly? Not sure... but
> it was a deliberate choice to not bring in any symbols into Prelude that
> weren't already there that weren't part of the definition of a class or
> needed to define instances that already existed.
>
> -Edward
>
> On Mon, Mar 30, 2015 at 11:33 PM, Fumiaki Kinoshita <fumiexcel at gmail.com>
> wrote:
>
>> Well, I see. It'd be nice.
>>
>> That aside, the absence of traverse_ doesn't seem to be intended (even
>> the documentation for mapM_ says "mapM_ is just traverse_"!)
>>
>> 2015-03-30 16:54 GMT+09:00 Herbert Valerio Riedel <hvr at gnu.org>:
>>
>>> On 2015-03-30 at 07:05:56 +0200, Fumiaki Kinoshita wrote:
>>>
>>> [...]
>>>
>>> > I found out that (<>) (in Data.Monoid) is missing, also. It would be
>>> nice
>>> > to reexamine Prelude to export things we want to export.
>>>
>>> Fwiw, (<>) was actually left-out as it wasn't required (it's just a an
>>> alias for `mappend`), *and* to keep our options open (or at least not
>>> make it more difficult) in terms of possible migration-plans available
>>> for the case we'd be moving 'Semigroup' to base/Prelude at some point in
>>> the future.
>>>
>>>
>>
>> _______________________________________________
>> ghc-devs mailing list
>> ghc-devs at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150331/5b35663e/attachment.html>

Reply | Threaded
Open this post in threaded view
|

traverse_

Edward Kmett-2
I have no objection to having the discussion about widening the set of
symbols to shave off warts like this in 7.12.

-Edward

On Tue, Mar 31, 2015 at 10:11 AM, Fumiaki Kinoshita <fumiexcel at gmail.com>
wrote:

> I understand the ground. It seems reasonable not to add symbols facilely.
>
> But in this case, the "too specialized" version is exported while more
> fundamental one is not.
> Although folks (including me) use mapM_ mostly today, someday we will like
> to have traverse_, I guess.
>
> 2015-03-31 19:41 GMT+09:00 Edward Kmett <ekmett at gmail.com>:
>
>> We deliberately took no more symbols than we needed in 7.10 from Prelude
>> as part of the Foldable/Traversable Proposal. There are multiple
>> combinators in Data.Foldable and Data.Traversable that we do not export.
>> traverse_ is one of them as, strictly speaking, traverse_ was a symbol we
>> didn't have to take.
>>
>> If we had would anybody have complained any more loudly? Not sure... but
>> it was a deliberate choice to not bring in any symbols into Prelude that
>> weren't already there that weren't part of the definition of a class or
>> needed to define instances that already existed.
>>
>> -Edward
>>
>> On Mon, Mar 30, 2015 at 11:33 PM, Fumiaki Kinoshita <fumiexcel at gmail.com>
>> wrote:
>>
>>> Well, I see. It'd be nice.
>>>
>>> That aside, the absence of traverse_ doesn't seem to be intended (even
>>> the documentation for mapM_ says "mapM_ is just traverse_"!)
>>>
>>> 2015-03-30 16:54 GMT+09:00 Herbert Valerio Riedel <hvr at gnu.org>:
>>>
>>>> On 2015-03-30 at 07:05:56 +0200, Fumiaki Kinoshita wrote:
>>>>
>>>> [...]
>>>>
>>>> > I found out that (<>) (in Data.Monoid) is missing, also. It would be
>>>> nice
>>>> > to reexamine Prelude to export things we want to export.
>>>>
>>>> Fwiw, (<>) was actually left-out as it wasn't required (it's just a an
>>>> alias for `mappend`), *and* to keep our options open (or at least not
>>>> make it more difficult) in terms of possible migration-plans available
>>>> for the case we'd be moving 'Semigroup' to base/Prelude at some point in
>>>> the future.
>>>>
>>>>
>>>
>>> _______________________________________________
>>> ghc-devs mailing list
>>> ghc-devs at haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150331/6be3d1ea/attachment.html>