5 ms·
Ubiquitous single-letter symbols mapping to who-knows-what possible things, pnflly abvted fncn nms, and unclear motivations for code are what I've bounced off o
by ashark 9y ago
Ubiquitous single-letter symbols mapping to who-knows-what possible things, pnflly abvted fncn nms, and unclear motivations for code are what I've bounced off of with Haskell every time I've tried to dig in. The community seems to have adopted all the worst parts of mathematics culture, along with whichever good parts they've brought in.
- draw_down 9y agoYeah, reading that shit drives me nuts.
- wereHamster 9y agoSerious question. In the following code, what would be better function / type names? (or you can pick another bit of Haskell code that you know and/or have particular trouble understanding). class Foldable t where foldl :: (b -> a -> b) -> b -> t a -> b
- nv-vn 9y agoI've always disliked mapM_. Something about it just looks ugly and it doesn't really hint what its for. I would like to see mapM as mapMonad and mapM_ as eachMonad. Of course, once I knew what it meant the abbreviations became rather nice.
- deleted 9y ago[deleted]
- nimih 9y agoMaybe 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.