summaryrefslogtreecommitdiff
path: root/Base64.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-05-15 02:49:43 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-05-15 03:38:08 -0400
commitcad0e1c8b7eb21f8dceca8dd9fa3bc1d1aa7eabd (patch)
treeb6be12dc1cc83a35ca7d89a862d85e6d71c38572 /Base64.hs
parentefa7f544050c0d5be6bc1b0fc0125278e475c213 (diff)
simplified a bunch of Maybe handling
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"