summaryrefslogtreecommitdiff
path: root/Base64.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Base64.hs')
-rw-r--r--Base64.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/Base64.hs b/Base64.hs
index cc6346b41..153049751 100644
--- a/Base64.hs
+++ b/Base64.hs
@@ -14,7 +14,5 @@ toB64 :: String -> String
toB64 = encode . s2w8
fromB64 :: String -> String
-fromB64 s =
- case decode s of
- Nothing -> error "bad base64 encoded data"
- Just ws -> w82s ws
+fromB64 s = maybe bad w82s $ decode s
+ where bad = error "bad base64 encoded data"