I just started studying Haskell and I'm reading a book called: Learn You a Haskell for Great Good!
In chapter 2, there is something I don't get.
When I am comparing two strings using the ">" operator for ex:
ghci> "Abrakadabra" < "Zebra"
True
I don't understand why it returns true. I tried to analyze this based on characters being ASCII, but I still don't understand why. What I thought is that we compare the number of characters in the string, but this example changed how I understood it in the first place.
Could someone please clarify this for me?
This is lexicographic ordering, which is what you should expect if you look something up in a dictionary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With