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

Well, yes, you can add a rectangle quite easily:

    type Shape =
        | Circle of float
        | Square of float
        | Rectangle of float * float
The thought about adding new shapes (mentioned several times in this thread) is just misplaced. If you're releasing library code people should not be extending your built-in types, that's bad form -- consumers of a library should interact with it through interfaces only.


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

Search: