diff options
author | Joey Hess <joey@kitenet.net> | 2011-05-15 02:49:43 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-05-15 03:38:08 -0400 |
commit | cad0e1c8b7eb21f8dceca8dd9fa3bc1d1aa7eabd (patch) | |
tree | b6be12dc1cc83a35ca7d89a862d85e6d71c38572 /Base64.hs | |
parent | efa7f544050c0d5be6bc1b0fc0125278e475c213 (diff) |
simplified a bunch of Maybe handling
Diffstat (limited to 'Base64.hs')
-rw-r--r-- | Base64.hs | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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" |