packages feed

apiary-purescript 1.3.0 → 1.3.1

raw patch · 2 files changed

+8/−10 lines, 2 filesdep −utf8-stringdep ~apiaryPVP ok

version bump matches the API change (PVP)

Dependencies removed: utf8-string

Dependency ranges changed: apiary

API changes (from Hackage documentation)

Files

apiary-purescript.cabal view
@@ -1,5 +1,5 @@ name:                apiary-purescript-version:             1.3.0+version:             1.3.1 synopsis:            purescript compiler for apiary web framework. description:   example: <https://github.com/philopon/apiary/blob/master/examples/pureScript.hs>@@ -20,11 +20,10 @@   exposed-modules:     Web.Apiary.PureScript   other-modules:       Web.Apiary.PureScript.Internal   build-depends:       base                 >=4.6   && <4.8-                     , apiary               >=1.1   && <1.4+                     , apiary               >=1.2   && <1.4                      , purescript           >=0.6   && <0.7                       , filepath             >=1.3   && <1.4-                     , utf8-string          >=0.3   && <0.4                      , text                 >=1.1   && <1.3                      , bytestring           >=0.10  && <0.11                      , unordered-containers >=0.2   && <0.3
src/Web/Apiary/PureScript/Internal.hs view
@@ -8,11 +8,10 @@ module Web.Apiary.PureScript.Internal where  import qualified System.FilePath.Glob as G-import qualified System.IO.UTF8 as U  import qualified Language.PureScript as P -import Control.Monad.Apiary.Action(ActionT, contentType, string, bytes)+import Control.Monad.Apiary.Action(ActionT, contentType, appendString, appendBytes, string, bytes) import Control.Exception(Exception, throwIO, try) import Control.Applicative((<$>)) @@ -71,7 +70,7 @@ compile :: PureScriptConfig -> FilePath -> IO String compile opt p = do     mods <- G.globDir (libraryPatterns opt) (libraryBaseDir opt)-        >>= mapM (\f -> (f,) <$> U.readFile f) . (p:) . concat . fst+        >>= mapM (\f -> (f,) <$> readFile f) . (p:) . concat . fst     case P.parseModulesFromFiles id $ ("prelude", P.prelude) : mods of         Left l   -> throwIO (ParseError l)         Right ms -> case P.compile (pureScriptOptions opt) (map snd ms) (pureScriptPrefix opt) of@@ -93,10 +92,10 @@     case s of         Right r -> string r         Left  e | development (pscConfig env) -> do-            bytes "console.log(\""-            string $ pr (e :: PureScriptException)-            bytes "\")"-                | otherwise -> bytes "console.log(\"PureScript error.\");"+            bytes "console.error(\""+            appendString $ pr (e :: PureScriptException)+            appendBytes "\")"+                | otherwise -> bytes "console.error(\"PureScript error.\");"   where     pr = concatMap esc . show     esc '"'  = "\\\""