about summary refs log tree commit diff
path: root/website/sandbox/learnpianochords/src/server/TestUtils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'website/sandbox/learnpianochords/src/server/TestUtils.hs')
-rw-r--r--website/sandbox/learnpianochords/src/server/TestUtils.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/website/sandbox/learnpianochords/src/server/TestUtils.hs b/website/sandbox/learnpianochords/src/server/TestUtils.hs
index c586f7f219ba..e62950369e65 100644
--- a/website/sandbox/learnpianochords/src/server/TestUtils.hs
+++ b/website/sandbox/learnpianochords/src/server/TestUtils.hs
@@ -10,3 +10,7 @@ unsafeStringOrURI x =
   case stringOrURI (cs x) of
     Nothing -> error $ "Failed to convert to StringOrURI: " ++ x
     Just x  -> x
+
+unsafeJust :: Maybe a -> a
+unsafeJust Nothing = error "Attempted to force a Nothing to be a something"
+unsafeJust (Just x) = x