4 ms·
Interestingly, you can do it with types and no parser help: https://gist.github.com/dlthomas/d18d475068f23584d473#file-chained-hs https://gist.github.com/dlthom
by dllthomas 12y ago
Interestingly, you can do it with types and no parser help: https://gist.github.com/dlthomas/d18d475068f23584d473#file-chained-hs 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