4 ms·
Examples on the home page have broken indentation, or just a multi-level indentation that is confusing? class Point: x y z :: Int origin
by shalabhc 9y ago
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?)
- marxidad 9y agoTo line up the equal signs, so all assigned values are aligned as well.
- wdanilo 9y agoYou are right, all the last 3 lines should be aligned max to the left. We'll fix that soon on new website!
- shalabhc 9y agoAnother 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.