-
Notifications
You must be signed in to change notification settings - Fork 201
Closed
Labels
Description
I don't know if this is something you all want to solve but there's some really weird behavior that happens due to eagerly converting for endiannes at construction of PortNumber (I assume that's what's going on)
50000 < (51000 :: PortNumber)
False
50000 < (52000 :: PortNumber)
True
I discovered this when attempting to validate a port range (PortNumber, PortNumber) such that the first is <= the second. I expect one solution would be to covert back to integer for Ord. Another would be to not pre-convert the word into network byte order until you need it internally (perhaps even creating an internal newtype to convert between the two), but that sounds very tricky to get right and a much larger diff.