foldMapDefault and traverse_

19 views
Skip to first unread message

Runar Bjarnason

unread,
May 4, 2012, 2:50:59 PM5/4/12
to sca...@googlegroups.com
What happened to foldMapDefault (for Traverse with Monoid) and traverse_ (for Foldable with Unit)?

They are in Scalaz 6, but seem to have not made it to 7. Replaced with something, or just not yet transferred over?

Runar

Jason Zaugg

unread,
May 4, 2012, 4:07:13 PM5/4/12
to sca...@googlegroups.com
The first is now foldmap() (with a default arg of id )

Not sure about traverse_, feel free to add...
> --
> You received this message because you are subscribed to the Google Groups
> "scalaz" group.
> To post to this group, send email to sca...@googlegroups.com.
> To unsubscribe from this group, send email to
> scalaz+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/scalaz?hl=en.
>
>

Runar Bjarnason

unread,
May 4, 2012, 4:12:18 PM5/4/12
to sca...@googlegroups.com
Is the Foldable instance automatically constructed from the Traverse in order to invoke foldMap?

Will add traverse._, although that too is just a specialization of foldMap.

Runar

Jason Zaugg

unread,
May 4, 2012, 5:15:48 PM5/4/12
to sca...@googlegroups.com
On Fri, May 4, 2012 at 10:12 PM, Runar Bjarnason <runar...@gmail.com> wrote:
> Is the Foldable instance automatically constructed from the Traverse in
> order to invoke foldMap?
>
> Will add traverse._, although that too is just a specialization of foldMap.

Traverse[F] is a subtype of Foldable[F]. If you define
Traverse#traverseImpl, you get foldMap for free.

-jason

Runar Bjarnason

unread,
May 4, 2012, 5:20:26 PM5/4/12
to sca...@googlegroups.com
Oh nice! Thanks, Jason.



Reply all
Reply to author
Forward
0 new messages