summaryrefslogtreecommitdiff
path: root/lengthComp.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lengthComp.hs')
-rw-r--r--lengthComp.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/lengthComp.hs b/lengthComp.hs
new file mode 100644
index 0000000..e4457d2
--- /dev/null
+++ b/lengthComp.hs
@@ -0,0 +1,4 @@
+import Data.Monoid
+
+lengthComp :: String -> String -> Ordering
+lengthComp x y = (length x `compare` length y) `mappend` (x `compare` y)