Skip to main content
cycles u/cycles avatar

cycles

u/cycles

Feed options
Hot
New
Top
View
Card
Compact



getRHLines can be written nicely with the new aeson-lens package (which is fantastic):

import Control.Lens
import Data.Aeson.Lens

getRHLines :: Value -> Maybe Integer
getRHLines json = json ^. key "lines"

As long as you can produce a Value (which you can get via a decode and the case analysis to make sure the parse succeed), you can maybe get the lines property out of it, by looking at the "lines" path. If the Value isn't an Object this will fail, and it will also fail if there is no 'lines' key, or if the 'lines' key is not an integer. All of this in hardly any characters!



While I agree that Snap is quiet, I'd just like to say that I use Snap frequently and haven't really hit any limitations. It's capable of a LOT right now, so I'm less worried about speed of development. Idling in IRC assures me that there are devs that are patiently working on things too :)


Actually, to be fair I did check your GitHub to back my statement up and was like "huh, actually he's still really active :P". I think I was just bummed about waiting so long for the decodeEither patch for aeson, call me greedy :P Thanks for all your work!


That's a good point, I've never tinkered in GHC but I should at some point, I don't want it to remain a black box to me. I wonder what percentage of Haskellers have hacked on GHC?

Not enough, I'd bet. There a few open GADT bugs that are bothering me in some of my own code atm, I might use both these bugs and this post as motivation to sort it out!


http://joyridelabs.de/game/ looks perfectly 'real world' and 'usable' to me. Maybe it's time we stopped the 'Haskell is only academic' meme?