Hacker News new | ask | show | jobs
by drdaeman 3378 days ago
I know some Haskell, but don't find code like this to be very readable:

    offsetParams :: M.HashMap ByteString NonnegRange
    offsetParams = M.fromList [(toS (replaceLast "limit" k), fromMaybe allRange (rangeGeq <$> (readMaybe =<< (toS <$> v)))) | (k,v) <- qParams, isJust v, endingIn ["offset"] k]
Not because it's something I don't understand at the concept level (there isn't anything complicated there), but because of the formatting and general lack of comments.

Maybe I'm talking about bike shed color, but it could be much better just by having some extra newlines that separate the pieces of list comprehension expression.