From: pho Date: Wed, 23 Jan 2008 02:53:34 +0000 (+0900) Subject: fix for interface change of Codec.Binary.Base64 X-Git-Tag: RELEASE-0_2_1~10 X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=caa8be5a8542b350c50ce9ad327332acd55286a5;p=Lucu.git fix for interface change of Codec.Binary.Base64 darcs-hash:20080123025334-62b54-10c85d001971753f192f68d364efd416da6052fa.gz --- diff --git a/ImplantFile.hs b/ImplantFile.hs index 7410b5f..8ba976d 100644 --- a/ImplantFile.hs +++ b/ImplantFile.hs @@ -120,6 +120,8 @@ generateHaskellSource opts srcFile False Nothing Nothing , HsImportDecl undefined (Module "Data.ByteString.Lazy") True (Just (Module "L")) Nothing + , HsImportDecl undefined (Module "Data.Maybe") + False Nothing Nothing , HsImportDecl undefined (Module "Data.Time") False Nothing Nothing , HsImportDecl undefined (Module "Network.HTTP.Lucu") @@ -300,8 +302,10 @@ generateHaskellSource opts srcFile defGZippedData = HsApp (HsVar (Qual (Module "L") (HsIdent "pack"))) (HsParen - (HsApp (HsVar (UnQual (HsIdent "decode"))) - (HsLit (HsString gzippedB64)))) + (HsApp (HsVar (UnQual (HsIdent "fromJust"))) + (HsParen + (HsApp (HsVar (UnQual (HsIdent "decode"))) + (HsLit (HsString gzippedB64)))))) declRawData :: [HsDecl] declRawData @@ -316,8 +320,10 @@ generateHaskellSource opts srcFile defRawData = HsApp (HsVar (Qual (Module "L") (HsIdent "pack"))) (HsParen - (HsApp (HsVar (UnQual (HsIdent "decode"))) - (HsLit (HsString rawB64)))) + (HsApp (HsVar (UnQual (HsIdent "fromJust"))) + (HsParen + (HsApp (HsVar (UnQual (HsIdent "decode"))) + (HsLit (HsString rawB64)))))) hPutStrLn output header hPutStrLn output (prettyPrint hsModule) @@ -459,6 +465,7 @@ openOutput opts module Foo.Bar.Baz (baz) where import Codec.Binary.Base64 import qualified Data.ByteString.Lazy as L + import Data.Maybe import Data.Time import Network.HTTP.Lucu @@ -486,7 +493,7 @@ openOutput opts contentType = read "image/png" rawData :: L.ByteString - rawData = L.pack (decode "IyEvdXNyL2Jpbi9lbnYgcnVuZ2hjCgppbXBvcnQgRGlzdHJ...") + rawData = L.pack (fromJust (decode "IyEvdXNyL2Jpbi9lbnYgcnVuZ2hjCgppbXBvcnQgRGlzdHJ...")) ------------------------------------------------------------------------------ 壓縮される場合は次のやうに變はる: @@ -518,6 +525,6 @@ openOutput opts -- rawData の代はりに gzippedData gzippedData :: L.ByteString - gzippedData = L.pack (decode "Otb/+DniOlRgAAAAYAAAAGAAAAB/6QOmToAEIGAAAAB...") + gzippedData = L.pack (fromJust (decode "Otb/+DniOlRgAAAAYAAAAGAAAAB/6QOmToAEIGAAAAB...")) ------------------------------------------------------------------------------ -}