Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Wow. That's much better.

Apparently-idiomatic Haskell reads (or, rather, doesn't) about like line-noise/code-golf style Perl to me.


The 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.


I wonder if anyone has worked on a Prelude replacement which has these replacements (along with renaming functions where appropriate)...


To 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.


Really? I find the single-letter version far easier to read.


The single letter version is far easier since I already know what foldable does. Not so much when I'm learning a new library.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: