shithub: MicroHs

Download patch

ref: 0afa916582a4dcb16415a30e0f62f4ab2316c681
parent: fe359d7d4a3701fdc9d18a5dcf95ade21690a731
author: Lennart Augustsson <lennart@augustsson.net>
date: Tue Dec 19 16:01:45 EST 2023

Add missing Ord instance

--- a/lib/Data/List.hs
+++ b/lib/Data/List.hs
@@ -28,6 +28,11 @@
   (x:xs) == (y:ys)  =  x == y && xs == ys
   _      == _       =  False
 
+instance forall a . Ord a => Ord [a] where
+  []     <= _       =  True
+  (_:_)  <= []      =  False
+  (x:xs) <= (y:ys)  =  x < y || x == y && xs <= ys
+
 instance Functor [] where
   fmap = map
 
--