on develop help sign in
Get generator package building again

I presume it got into a state where it wasn't actually compiling but was comitted. The versions of things like pandoc and formatting that are pinned in the stack LTS being chosen are not type-compatible with how they were being used. It is worth noting that I started to go down the path of upgrading to LTS-12 in `gen` but this incurs a breaking change in haskell-src-exts, which requires fixing hundreds of type errors, so this was the path of least resistence. Probably a good idea to do that long term though.

commitbdfe880a960832ddbf7b6a3c639aadbc3089b52c authorMichael Xavier <michael@michaelxavier.net> dateThu 20 Dec 2018, 09:27 (8 years ago) parent45b383b
6 files changed+11−14
gen/.stylish-haskell.yaml+5−2 gen/gogol-gen.cabal+1−1 gen/src/Gen/Formatting.hs+1 gen/src/Gen/IO.hs+1−1 gen/src/Gen/Types/Help.hs+3−5 gen/stack.yaml−5
gen/.stylish-haskell.yaml+5−2
@@ -4,7 +4,10 @@ steps:
44 - language_pragmas:
55 style: vertical
66 remove_redundant: true
7− - records: {}
7+ - simple_align:
8+ cases: true
9+ top_level_patterns: true
10+ records: true
811 - trailing_whitespace: {}
912
1013columns: 80
@@ -12,4 +15,4 @@ columns: 80
1215language_extensions:
1316 - MultiParamTypeClasses
1417 - TypeOperators
15− - DataKinds
18+ - DataKinds
gen/gogol-gen.cabal+1−1
@@ -60,7 +60,7 @@ executable gogol-gen
6060 , lens
6161 , mtl
6262 , optparse-applicative
63− , pandoc
63+ , pandoc < 2.0
6464 , parsec
6565 , semigroups
6666 , system-fileio
gen/src/Gen/Formatting.hs+1
@@ -10,6 +10,7 @@
1010module Gen.Formatting
1111 ( module Gen.Formatting
1212 , module Formatting
13+ , module Formatting.Internal
1314 , module Formatting.Time
1415 ) where
1516
gen/src/Gen/IO.hs+1−1
@@ -33,7 +33,7 @@ import qualified Filesystem as FS
3333import qualified Text.EDE as EDE
3434
3535run :: ExceptT Error IO a -> IO a
36−run = runScript . fmapLT LText.toStrict
36+run = runScript . fmapLT LText.unpack
3737
3838io :: MonadIO m => IO a -> ExceptT Error m a
3939io = ExceptT . fmap (first (LText.pack . show)) . liftIO . runUIO . fromIO
gen/src/Gen/Types/Help.hs+3−5
@@ -19,6 +19,7 @@ import Data.Aeson
1919import Data.Char (isSpace)
2020import Data.String
2121import Data.Text (Text)
22+import qualified Data.Text as T
2223
2324import Text.Pandoc as Pandoc
2425import Text.Pandoc.Pretty
@@ -54,7 +55,7 @@ rawHelpText = Raw
5455
5556instance FromJSON Help where
5657 parseJSON = withText "help" $ \t ->
57− case Pandoc.runPure (Pandoc.readHtml def t) of
58+ case Pandoc.readHtml def (T.unpack t) of
5859 Left e -> fail (show e)
5960 Right x -> pure $! Pan x t
6061
@@ -83,10 +84,7 @@ flatten :: Help -> String
8384flatten = \case
8485 Help xs -> foldMap flatten xs
8586 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
87+ Pan d _t -> Pandoc.writeHaddock def d
9088
9189wrap :: String -> String -> Text
9290wrap sep =
gen/stack.yaml−5
@@ -1,4 +1,3 @@
1−compiler: ghc-8.0.2
21resolver: lts-8.18
32
43flags: {}
@@ -10,7 +9,3 @@ extra-deps:
109
1110packages:
1211 - '.'
13−
14−nix:
15− enable: true
16− packages: [zlib, icu]