Which means we can turn -Werror back on.
Made sure to get a full rebuild with:
```
rm -rf .stack-work/dist/*
bin/build # really just `stack build --file-watch`
bin/lint
bin/test
```
build-depends: base >=4.8 && <4.9
, docvim
- ghc-options: -W -Wall
+ ghc-options: -W -Wall -Werror
-- Directories containing source files.
hs-source-dirs: src
, Text.Docvim.Visitor.Section
, Text.Docvim.Visitor.Symbol
, Paths_docvim
- ghc-options: -W -Wall
+ ghc-options: -W -Wall -Werror
hs-source-dirs: lib
test-suite hlint
build-depends: base
, hlint
default-language: Haskell2010
- ghc-options: -W -Wall
+ ghc-options: -W -Wall -Werror
hs-source-dirs: tests
main-is: HLint.hs
type: exitcode-stdio-1.0
, Text.Docvim.Visitor.Section
, Text.Docvim.Visitor.Symbol
default-language: Haskell2010
- ghc-options: -W -Wall
+ ghc-options: -W -Wall -Werror
hs-source-dirs: tests
, lib
main-is: Tasty.hs
{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE RankNTypes #-}
module Text.Docvim.AST where
keepValid = filter (`elem` (['a'..'z'] ++ ['0'..'9'] ++ " -"))
downcase = map toLower
+invalidNode :: forall t. t
invalidNode = error "Invalid Node type"
import Data.Maybe
import Text.Docvim.AST
import Text.Docvim.Parse
-import Text.Docvim.Visitor.Plugin
import Text.Docvim.Visitor.Symbol
data Metadata = Metadata { symbols :: [String] }
type Env = Reader Metadata String
data Anchor = Anchor [Attribute] String
-data Attribute = Attribute { attributeName :: String
- , attributeValue :: String
- }
+data Attribute = Attribute String String
markdown :: Node -> String
markdown n = rstrip (runReader (node n) metadata) ++ "\n"
import Text.Docvim.AST
import Text.Docvim.Parse
import Text.Docvim.Visitor.Plugin
-import Text.Docvim.Visitor.Symbol
-- TODO: add indentation here (using local, or just stick it in Context)
extractBlocks start = go
where
go [] = (empty, [])
- go (x:xs) = maybe no_extract extract (start x)
+ go (x:xs) = maybe no_extract extract' (start x)
where
no_extract = (extracted, x:unextracted)
where
~(extracted, unextracted) = go xs
- extract stop = (pure (x:block) <|> extracted, unextracted)
+ extract' stop = (pure (x:block) <|> extracted, unextracted)
where
~(block, remainder) = break stop xs
~(extracted, unextracted) = go remainder
module Text.Docvim.Visitor.Symbol (getSymbols) where
-import Data.Char
import Data.List
import Text.Docvim.AST
import Text.Docvim.Visitor.Plugin