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

I haven't checked this, but I believe that:

    over location.x (+ 10) $ player1
Would be read as:

    (over location) . (x (+ 10)) $ player1
It looks like what you want is:

    over (location . x) (+ 10) $ player1


Yeah that's a slight niggle with Lens using (.). From an "object oriented" point of view it looks like (.) should have higher precedence than the function application, but in Haskell it doesn't.


That's why I really dislike the tendency for people to use "foo.bar" with Lens instead of "foo . bar". I find the lack of spaces makes it really easy for my brain to slip into OO mode and start forgetting precedence.


Yeah I'd agree with you there.


Ah, of course! Thank you, I'll amend the post.




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

Search: