]> git.wincent.com - docvim.git/commitdiff
Fix remaining warnings
authorGreg Hurrell <greg@hurrell.net>
Fri, 10 Jun 2016 05:56:21 +0000 (22:56 -0700)
committerGreg Hurrell <greg@hurrell.net>
Fri, 10 Jun 2016 05:56:21 +0000 (22:56 -0700)
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
```

docvim.cabal
lib/Text/Docvim/AST.hs
lib/Text/Docvim/Printer/Markdown.hs
lib/Text/Docvim/Printer/Vim.hs
lib/Text/Docvim/Visitor.hs
lib/Text/Docvim/Visitor/Symbol.hs

index df870290239de80e131cb1453e949dee82ece67e..f64e8ac8e52be9503bd4210c5ce78bce097e9dc6 100644 (file)
@@ -71,7 +71,7 @@ executable docvim
   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
@@ -118,14 +118,14 @@ library
                  ,  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
@@ -169,7 +169,7 @@ test-suite tasty
                ,     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
index 882d9cf02b28cef7fb48e0a05445a316379f4a92..58ef984ab71f7f1c3a1ea5be9f987a5f8598a1f0 100644 (file)
@@ -1,4 +1,5 @@
 {-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE RankNTypes #-}
 
 module Text.Docvim.AST where
 
@@ -155,4 +156,5 @@ sanitizeAnchor = hyphenate . keepValid . downcase
     keepValid = filter (`elem` (['a'..'z'] ++ ['0'..'9'] ++ " -"))
     downcase = map toLower
 
+invalidNode :: forall t. t
 invalidNode = error "Invalid Node type"
index 0080a126be7fce9b02a607d65aaf8fc1f7fba511..af195d8077329e8c3311299833e9b1362e4f416b 100644 (file)
@@ -5,16 +5,13 @@ import Data.List
 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"
index 2fd82127a02467622ecd82f379559319f5814039..b410b6fe88b9ef092ff4b799e0a04c675a0e789a 100644 (file)
@@ -12,7 +12,6 @@ import Data.Tuple
 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)
 
index 2ec37b464e8cadd678ce55507c2948369f61ce32..ace5e0615522804c743c3a9f5208469b17e042e7 100644 (file)
@@ -39,12 +39,12 @@ extractBlocks :: Alternative f => (a -> Maybe (a -> Bool)) -> [a] -> (f [a], [a]
 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
index 106c2c4ea882625f84f690a0c4aa414a3cd27696..81fd6ad98b878fc51efd792c6dbd522e678b1b7c 100644 (file)
@@ -1,6 +1,5 @@
 module Text.Docvim.Visitor.Symbol (getSymbols) where
 
-import Data.Char
 import Data.List
 import Text.Docvim.AST
 import Text.Docvim.Visitor.Plugin