While hunting for a bug, deep in some Haskell code, I found minimum used on a tuple. The code was expecting the smallest value to be returned. This took me a long time to debug. Can anyone explain why minimum behaves as it does with tuples? This feels like an easy mistake to make.
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
Prelude> minimum [0,2]
0
Prelude> minimum [2,0]
0
Prelude> minimum (0,2)
2
Prelude> minimum (2,0)
0
Prelude>