on develop help sign in
Updating stackage resolver and minor generator build fixes
commit477512eee6aa14f840670921d45b502dfc87d2cf authorBrendan Hay <brendan.g.hay@gmail.com> dateFri 18 May 2018, 10:59 (8 years ago) parente31ece9
8 files changed+78−54
gen/src/Gen/Formatting.hs−1 gen/src/Gen/IO.hs+11−5 gen/src/Gen/Types/Help.hs+28−24 gen/stack.yaml−12 stack-7.10.3.yaml+11−3 stack-8.0.2.yaml+10−4 stack-8.2.yaml → stack-8.2.2.yaml+17−4 stack.yaml+1−1
gen/src/Gen/Formatting.hs−1
@@ -11,7 +11,6 @@ module Gen.Formatting
1111 ( module Gen.Formatting
1212 , module Formatting
1313 , module Formatting.Time
14− , runFormat
1514 ) where
1615
1716import Control.Monad.Except
gen/src/Gen/IO.hs+11−5
@@ -13,21 +13,27 @@ module Gen.IO where
1313
1414import Control.Error
1515import Control.Monad.Except
16+
1617import Data.Bifunctor (first)
1718import Data.ByteString (ByteString)
18−import qualified Data.Text.Lazy as LText
1919import Data.Text.Lazy.Builder (toLazyText)
20−import qualified Data.Text.Lazy.IO as LText
21−import qualified Filesystem as FS
20+
2221import Filesystem.Path.CurrentOS
22+
2323import Gen.Formatting
2424import Gen.Types
25+
2526import System.IO
26−import qualified Text.EDE as EDE
27+
2728import UnexceptionalIO (fromIO, runUIO)
2829
30+import qualified Data.Text.Lazy as LText
31+import qualified Data.Text.Lazy.IO as LText
32+import qualified Filesystem as FS
33+import qualified Text.EDE as EDE
34+
2935run :: ExceptT Error IO a -> IO a
30−run = runScript . fmapLT LText.unpack
36+run = runScript . fmapLT LText.toStrict
3137
3238io :: MonadIO m => IO a -> ExceptT Error m a
3339io = ExceptT . fmap (first (LText.pack . show)) . liftIO . runUIO . fromIO
gen/src/Gen/Types/Help.hs+28−24
@@ -15,30 +15,32 @@ module Gen.Types.Help
1515 , rawHelpText
1616 ) where
1717
18−import Data.Aeson
19−import Data.Char (isSpace)
20−import Data.String
21−import Data.Text (Text)
22−import qualified Data.Text as Text
23−import Text.Pandoc
24−import Text.Pandoc.Pretty
18+import Data.Aeson
19+import Data.Char (isSpace)
20+import Data.String
21+import Data.Text (Text)
22+
23+import Text.Pandoc as Pandoc
24+import Text.Pandoc.Pretty
25+
26+import qualified Data.Text as Text
2527
2628data Help
27− = Help [Help]
28− | Pan Pandoc
29− | Raw Text
29+ = Help ![Help]
30+ | Pan !Pandoc !Text
31+ | Raw !Text
3032 deriving (Eq)
3133
3234instance Monoid Help where
3335 mempty = Help []
3436 mappend x y =
3537 case (x, y) of
36− (Help a, Help b) -> Help (a <> b)
37− (Pan a, Pan b) -> Pan (a <> b)
38− (Raw a, Raw b) -> Raw (a <> b)
39− (Help a, b) -> Help (a <> [b])
40− (a, Help b) -> Help (a : b)
41− (a, b) -> Help [a, b]
38+ (Help a, Help b) -> Help (a <> b)
39+ (Pan a a', Pan b b') -> Pan (a <> b) (a' <> b')
40+ (Raw a, Raw b) -> Raw (a <> b)
41+ (Help a, b) -> Help (a <> [b])
42+ (a, Help b) -> Help (a : b)
43+ (a, b) -> Help [a, b]
4244
4345-- | Empty Show instance to avoid verbose debugging output.
4446instance Show Help where
@@ -51,11 +53,10 @@ rawHelpText :: Text -> Help
5153rawHelpText = Raw
5254
5355instance FromJSON Help where
54− parseJSON = withText "help" $
55− either (fail . show) pure
56− . fmap Pan
57− . readHtml def
58− . Text.unpack
56+ parseJSON = withText "help" $ \t ->
57+ case Pandoc.runPure (Pandoc.readHtml def t) of
58+ Left e -> fail (show e)
59+ Right x -> pure $! Pan x t
5960
6061instance ToJSON Help where
6162 toJSON = toJSON
@@ -80,9 +81,12 @@ instance ToJSON Below where
8081
8182flatten :: Help -> String
8283flatten = \case
83− Help xs -> foldMap flatten xs
84− Pan d -> writeHaddock def d
85− Raw t -> Text.unpack t
84+ Help xs -> foldMap flatten xs
85+ Raw t -> Text.unpack t
86+ Pan d t -> Text.unpack $
87+ case Pandoc.runPure (Pandoc.writeHaddock def d) of
88+ Left {} -> t
89+ Right x -> x
8690
8791wrap :: String -> String -> Text
8892wrap sep =
gen/stack.yamldeleted−12
@@ -1,12 +0,0 @@
1−compiler: ghc-8.0.2
2−resolver: lts-8.18
3−
4−flags: {}
5−
6−extra-deps:
7− - text-regex-replace-0.1.1.1
8− - haskell-src-exts-1.17.1
9− - hindent-4.6.4
10−
11−packages:
12− - '.'
stack-7.10.3.yaml+11−3
@@ -1,10 +1,18 @@
1−compiler: ghc-7.10.3
2−resolver: lts-7.6
3−flags: {}
1+compiler: ghc-7.10.3
2+resolver: lts-7.6
3+
4+local-bin-path: bin
5+
6+nix:
7+ enable: false
8+ packages: [zlib, icu]
9+ add-gc-roots: true
10+
411extra-deps:
512 - http-conduit-2.2.0
613 - http-client-0.5.0.1
714 - http-client-tls-0.3.0
15+
816packages:
917 - core
1018 - gogol
stack-8.0.2.yaml+10−4
@@ -1,7 +1,13 @@
1−compiler: ghc-8.0.2
2−resolver: lts-9.0
3−flags: {}
4−extra-deps: []
1+compiler: ghc-8.0.2
2+resolver: lts-9.0
3+
4+local-bin-path: bin
5+
6+nix:
7+ enable: false
8+ packages: [zlib, icu]
9+ add-gc-roots: true
10+
511packages:
612 - core
713 - gogol
stack-8.2.yaml → stack-8.2.2.yamlrenamed+17−4
@@ -1,8 +1,21 @@
1−compiler: ghc-8.2
2−resolver: nightly-2017-08-12
3−flags: {}
4−extra-deps: []
1+resolver: lts-11.9
2+
3+local-bin-path: bin
4+
5+nix:
6+ enable: false
7+ packages: [zlib, icu, unzip]
8+ add-gc-roots: true
9+
10+extra-deps:
11+ # gogol-gen specific
12+ - ede-0.2.9
13+ - haskell-src-exts-1.17.1
14+ - hindent-4.6.4
15+ - text-regex-replace-0.1.1.2
16+
517packages:
18+ - gen
619 - core
720 - gogol
821 - examples
stack.yaml+1−1
@@ -1 +1 @@
1−stack-8.2.yaml
1+stack-8.2.2.yaml