O'Reilly logo
  • Doug DesCombaz thinks this is interesting:

compareLastNames name1 name2 = if lastName1 > lastName2 then GT else if lastName1 < lastName2 then LT else EQ


Cover of Get Programming with Haskell


GT, LT, EQ are nice constants (or whatever they are called in Haskell). I'm thinking about how I don't like -1, 0, 1 in Java or other languages for expressing the same comparison.