Hacker News new | past | comments | ask | show | jobs | submit login

Examples on the home page have broken indentation, or just a multi-level indentation that is confusing?

    class Point:
        x y z :: Int
      origin      = Point 0 0 0
      Point x y _ = origin
      print 'Origin XY coords are ($x,$y)'

(Why is `origin =` indented at all?)



To line up the equal signs, so all assigned values are aligned as well.


You are right, all the last 3 lines should be aligned max to the left. We'll fix that soon on new website!


Another thing, this example wouldn't type check unless it is verifiably a list of non blank strings:

    print [s for s in lst if s.head != '_']
The section about dependent typing says `lst.head` would be a compile time error in some cases.




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

Search: