5 ms·
Maybe something like: class Foldable myFoldable where foldl :: (summary -> element -> summary) -> summary -> myFoldable element
by nimih 9y ago
Maybe something like:
class Foldable myFoldable where
foldl :: (summary -> element -> summary)
-> summary
-> myFoldable element
-> summary
This is the translation I do in my head when I read that type signature, at least.
- bjl 9y agoReally? I find the single-letter version far easier to read.
- imh 9y agoThe single letter version is far easier since I already know what foldable does. Not so much when I'm learning a new library.
- cauterize 9y agoI wonder if anyone has worked on a Prelude replacement which has these replacements (along with renaming functions where appropriate)...
- wereHamster 9y agoTo change the names you'd have to re-implement all the functions. Good luck with that, base is /large/. This is a documentation issue, not an implementation issue.
- ashark 9y agoWow. That's much better. Apparently-idiomatic Haskell reads (or, rather, doesn't) about like line-noise/code-golf style Perl to me.
- jinfiesto 9y agoThe problem with this is that there are Foldables that do not behave in the way that is implied by the above re-write of the parameters. I think this is kind of the problem when you are really high up in abstraction-land. The functions that you're using are so generic that it's hard to say that they operate on anything in particular, except that the arguments fulfill certain properties or laws.