about summary refs log tree commit diff
path: root/website/sandbox/chord-drill-sergeant/src/Misc.elm
diff options
context:
space:
mode:
Diffstat (limited to 'website/sandbox/chord-drill-sergeant/src/Misc.elm')
-rw-r--r--website/sandbox/chord-drill-sergeant/src/Misc.elm32
1 files changed, 26 insertions, 6 deletions
diff --git a/website/sandbox/chord-drill-sergeant/src/Misc.elm b/website/sandbox/chord-drill-sergeant/src/Misc.elm
index 479234ff1546..451c5c315c50 100644
--- a/website/sandbox/chord-drill-sergeant/src/Misc.elm
+++ b/website/sandbox/chord-drill-sergeant/src/Misc.elm
@@ -1,15 +1,35 @@
 module Misc exposing (..)
 
+
 comesAfter : a -> List a -> Maybe a
 comesAfter x xs =
     case xs of
-        []         -> Nothing
-        _::[]      -> Nothing
-        y::z::rest -> if y == x then Just z else comesAfter x (z::rest)
+        [] ->
+            Nothing
+
+        _ :: [] ->
+            Nothing
+
+        y :: z :: rest ->
+            if y == x then
+                Just z
+
+            else
+                comesAfter x (z :: rest)
+
 
 comesBefore : a -> List a -> Maybe a
 comesBefore x xs =
     case xs of
-        []         -> Nothing
-        _::[]      -> Nothing
-        y::z::rest -> if z == x then Just y else comesAfter x (z::rest)
+        [] ->
+            Nothing
+
+        _ :: [] ->
+            Nothing
+
+        y :: z :: rest ->
+            if z == x then
+                Just y
+
+            else
+                comesBefore x (z :: rest)