What do the LT and GT mean?

GHCi> compare 2 3 LT GHCi> compare 3 3 EQ GHCi> compare 4 3 GT 

I think EQ means equal, but what do LT and GT mean?

+6
source share
3 answers
  • compare 2 3 = LT - 2 L ess T han 3
  • compare 3 3 = EQ - 3 EQ to 3
  • compare 4 3 = GT - 4 G reater T han 3

It is not true that the documentation for Ordering does not explicitly say so.

+15
source

This is not only in haskell, GT and LT are very common and well-known abbreviations for Great and Less than respectively. Other common abbreviations for comparison: GE and LE , i.e. Large or equal and Less than or equal , but they are not part of the Haskell Ordering data constructors. You are right about EQ = "equal".

+6
source

LT = less

GT = more than

+4
source

Source: https://habr.com/ru/post/910978/


All Articles