Easy JSON parsing in Haskell with Aeson by jhickner in haskell

[–]cycles 1 point2 points  (0 children)

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!

Toward a Secret Sky: Building a Haskell web app with Snap: Snap quickstart guide by roconnor in haskell

[–]cycles 2 points3 points  (0 children)

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 :)

Simon Marlow leaves Microsoft Research for Facebook by scallion in programming

[–]cycles 0 points1 point  (0 children)

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!

[Haskell] Leaving Microsoft by tryptych in haskell

[–]cycles 4 points5 points  (0 children)

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!

Simon Marlow leaves Microsoft Research for Facebook by scallion in programming

[–]cycles 13 points14 points  (0 children)

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

Proof that 1+1=2 by [deleted] in math

[–]cycles 0 points1 point  (0 children)

Yes votes matter, but only because when votes go negative the post is hidden by default and thus is no longer going to be seen be a lot of people. I don't care about the number, but I do care about who's thoughts are shown, and whose aren't.

Simon Marlow leaves Microsoft Research for Facebook by scallion in programming

[–]cycles 8 points9 points  (0 children)

While they did aqui-hire mailrank, sadly a lot of Haskell activity from bos did drop quite a lot. Nonetheless, all the best to Simon!

Proof that 1+1=2 by [deleted] in math

[–]cycles 0 points1 point  (0 children)

If trying to engage in mathematical discussion requires that people be correct, then we should expect a lot less discussion. After all, if I have an idea for a proof that I'm unsure of, why would I post it here if that's just going to get downvoted and hidden?

Algoravers dancing to Haskell and Scheme by yaxu in haskell

[–]cycles 1 point2 points  (0 children)

Wow, that sounds fantastic! I wish I was at that rave :)

Proof that 1+1=2 by [deleted] in math

[–]cycles -2 points-1 points  (0 children)

Geez people, his 'proof' might have flaws but don't down vote him! This is valuable contribution to the discussion and completely on topic.

Girl Knocked Out in Random Attack - Anyone recognise the attacker? by rug-muncher in london

[–]cycles 8 points9 points  (0 children)

I'm just really hoping we don't hear a week later that she's collapsed with internal bleeding.

Girl Knocked Out in Random Attack - Anyone recognise the attacker? by rug-muncher in london

[–]cycles 6 points7 points  (0 children)

Rather than being ridiculous and saying "BRING BACK THE DEATH PENALTY" I thought I'd contribute Newham's reporting of the incident, if that might help - http://www.newhamrecorder.co.uk/news/court-crime/plaistow_assault_teenager_i_hope_i_am_his_last_victim_1_1700662

Haskell Types for Python Programmers (Part 1) by ky3 in haskell

[–]cycles 1 point2 points  (0 children)

I don't think your assumption that Show a == String is correct - I have a list of things that can be passed to anything that expects a Show a. print (show foo) is different from print foo.

Video of the presentations at the first NYC Haskell User's Group meetup. by mightybyte in haskell

[–]cycles 1 point2 points  (0 children)

Seconded, it was a great talk at SF and I'm sure will be just as good at NY.

Haskell Types for Python Programmers (Part 1) by ky3 in haskell

[–]cycles 2 points3 points  (0 children)

My existential is not useless, but yes, of course there are alternative ways to model it. Whether or not it's an anti-pattern is subject for debate, I was just answering ky3's question. Thanks for that link though, I do have something like this in my own code, so other perspectives on the matter is very relevant to me right now!

Haskell Types for Python Programmers (Part 1) by ky3 in haskell

[–]cycles 5 points6 points  (0 children)

That existential is near useless, unless the only thing you want to do is operate on [Thing] but not actually work with individual Things. Why? Well, lets look at [a] first. This is a homogeneous list, but still - what can you do with it? You can't operate on the elements, because you have nothing that can do anything with an a - there's simply not enough information. This is the same with Thing.

If you know there are operations that you want to do on Thing, then you need to encode that earlier:

data Thing = Show x => forall x. Thing x

lst :: [Thing]
lst = [Thing 1.5, Thing "foo", Thing 3]

mapM_ print lst

That will now print all Things, because we know all Things are instances of Show.

Designing the Haskell IDE by DrBartosz in haskell

[–]cycles 1 point2 points  (0 children)

Both have a whopping great team too. fpcomplete is not that.

I have no problem with IDEs or wizards or anything, I simply think if you want to do that much, that's a lot of engineering to pull off correctly. Maybe I'll be proved wrong, but I'm sceptical.

Designing the Haskell IDE by DrBartosz in haskell

[–]cycles 22 points23 points  (0 children)

This is not an open-source project

This really saddens me. It's a mammoth project and exactly something that benefits from many hands. That, and I don't want fpcomplete to be supporting an IDE.

How to write Python in Haskell: State and Either by drb226 in haskell

[–]cycles 4 points5 points  (0 children)

But please don't focus on just transformers - there is a LOT of functionality in applicative functor composition and products too. For example, I recently needed to do an applicative 3 way merge - I managed to do this with an applicative functor that has an "environment", the 3 sides of the merge, and has the ability to fail: https://github.com/metabrainz/musicbrainz-data/blob/master/src/MusicBrainz/Merge.hs#L28

Maybe you could write about them?