Skip to content

Commit

Permalink
toStrinct $ renderMarkup intend to be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
kanghyojun committed Feb 20, 2018
1 parent 9695195 commit f9bc8d5
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Nirum/Targets/Python.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ import Data.Text.Lazy (toStrict)
import Data.Text.Encoding (decodeUtf8, encodeUtf8)
import Data.Function (on)
import System.FilePath (joinPath)
import qualified Text.Blaze.Internal as BI
import Text.Blaze.Renderer.Text
import qualified Text.Email.Validate as E
import Text.Heterocephalus (compileText)
Expand Down Expand Up @@ -207,9 +206,6 @@ runCodeGen :: CodeGen a
-> (Either CompileError' a, CodeGenContext)
runCodeGen = C.runCodeGen

renderCompileText :: BI.Markup -> T.Text
renderCompileText = toStrict . renderMarkup

insertStandardImport :: T.Text -> CodeGen ()
insertStandardImport module' = ST.modify insert'
where
Expand Down Expand Up @@ -736,7 +732,7 @@ compileTypeDeclaration src d@TypeDeclaration { typename = typename'
, type' = Alias ctype
} = do
ctypeExpr <- compileTypeExpression src (Just ctype)
return $ renderCompileText $ [compileText|
return $ toStrict $ renderMarkup $ [compileText|
%{ case compileDocs d }
%{ of Just rst }
#: #{rst}
Expand Down Expand Up @@ -1035,7 +1031,7 @@ compileTypeDeclaration src
typeRepr <- typeReprCompiler
ret <- returnCompiler
arg <- parameterCompiler
return $ renderCompileText $ [compileText|
return $ toStrict $ renderMarkup $ [compileText|
class #{className}(#{T.intercalate "," $ compileExtendClasses annotations}):
#{compileDocstring " " d}

Expand Down Expand Up @@ -1426,7 +1422,7 @@ compileModule pythonVersion' source = do
let fromImports = M.assocs (localImportsMap context) ++
M.assocs (thirdPartyImports context)
code <- result
return $ (,) installRequires $ renderCompileText $
return $ (,) installRequires $ toStrict $ renderMarkup $
[compileText|# -*- coding: utf-8 -*-
#{compileDocstring "" $ sourceModule source}
%{ forall i <- S.elems (standardImports context) }
Expand Down Expand Up @@ -1471,7 +1467,7 @@ compilePackageMetadata Package
, modules = modules'
}
(InstallRequires deps optDeps) =
renderCompileText [compileText|# -*- coding: utf-8 -*-
toStrict $ renderMarkup [compileText|# -*- coding: utf-8 -*-
import sys

from setuptools import setup, __version__ as setuptools_version
Expand Down

0 comments on commit f9bc8d5

Please sign in to comment.