snoyberg / classy-prelude

A typeclass-based Prelude.
108 stars 15 forks source link

Standard folds #40

Closed nikita-volkov closed 11 years ago

nikita-volkov commented 11 years ago

I've simply reexported the standard Foldable functions, since I don't see other implementations possible. But even if I'm wrong we'll still be able to reimplement those in future if a requirement arises.

snoyberg commented 11 years ago

I'd be opposed to including the minimum and maximum functions, since they're partial. I have no objection to sum and product, however.

nikita-volkov commented 11 years ago

Agreed. I didn't give it much thought. Updated.

nikita-volkov commented 11 years ago

Concerning the general approach to partial functions, what do you think about introducing some type like this?

snoyberg commented 11 years ago

I think the more commonly used datatype is from http://hackage.haskell.org/package/semigroups. But I don't think these alternate datatypes are common enough to be provided as the default minimum exported by a prelude replacement.

nikita-volkov commented 11 years ago

Okay, let's put this issue aside for the time being.