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

Interestingly, you can do it with types and no parser help: https://gist.github.com/dlthomas/d18d475068f23584d473#file-c...

Obviously, that's not what's going on in Python...

It could be smoother and more generic if Haskell permitted specifying defaulting for non-numeric types. But it does support things like:

    *Main> 2 < 3 < 4 < 4 :: Bool
    False

    *Main> 2 < 3 < 4 <= 4 :: Bool
    True

    *Main> 2 <= 3 < 4 <= 4 :: Bool
    True

    *Main> 2 <= 3 > 4 <= 4 :: Bool
    False

    *Main> 2 <= 6 > 4 <= 4 :: Bool
    True



Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: