on develop help sign in
Fixing compiler warnings
commitf3a8118cf785d2676add3e857bdfcf153f1e977c authorBrendan Hay <brendan.g.hay@gmail.com> dateMon 9 May 2016, 11:26 (10 years ago) parent4592e14
5 files changed+7−18
gen/src/Gen/AST.hs−1 gen/src/Gen/AST/Render.hs+3−7 gen/src/Gen/AST/Solve.hs−1 gen/src/Gen/Types/Id.hs+4−4 gen/src/Gen/Types/Map.hs−5
gen/src/Gen/AST.hs−1
@@ -9,7 +9,6 @@ module Gen.AST where
99
1010import Control.Monad.Except
1111import Control.Monad.State.Strict
12−import Debug.Trace
1312import Gen.AST.Flatten (flatten)
1413import Gen.AST.Render (render)
1514import Gen.AST.Solve (solve)
gen/src/Gen/AST/Render.hs+3−7
@@ -25,17 +25,13 @@ module Gen.AST.Render
2525import Control.Applicative
2626import Control.Error
2727import Control.Lens hiding (enum, lens)
28−import Control.Monad.Except
2928import Data.Char (isSpace)
3029import qualified Data.HashMap.Strict as Map
3130import Data.Maybe
3231import Data.Semigroup ((<>))
3332import Data.String
34−import qualified Data.Text as Text
3533import qualified Data.Text.Lazy as LText
3634import qualified Data.Text.Lazy.Builder as Build
37−import Data.Text.Manipulate
38−import Debug.Trace
3935import Gen.AST.Solve (getSolved)
4036import Gen.Formatting
4137import Gen.Syntax
@@ -74,9 +70,9 @@ renderSchema s = go (_schema s)
7470
7571 object i (Obj aps ps) = do
7672 a <- traverse getSolved aps
77− p <- traverse getSolved ps
78− let ap = setAdditional <$> a
79− ts = maybe p (flip (Map.insert "addtional") p) ap
73+ b <- traverse getSolved ps
74+ let ab = setAdditional <$> a
75+ ts = maybe b (flip (Map.insert "addtional") b) ab
8076 prod ts
8177 where
8278 prod ts = Prod (dname k) (i ^. iDescription)
gen/src/Gen/AST/Solve.hs−1
@@ -39,7 +39,6 @@ import Data.Semigroup ((<>))
3939import Data.Text (Text)
4040import qualified Data.Text as Text
4141import Data.Text.Manipulate
42−import Debug.Trace
4342import Gen.Formatting
4443import Gen.Text
4544import Gen.Types
gen/src/Gen/Types/Id.hs+4−4
@@ -228,17 +228,17 @@ extractPath x = either (error . err) id $ A.parseOnly path x
228228 <*> optional (A.char ':' *> A.takeWhile1 (A.notInClass "/{+*}:"))
229229
230230orderParams :: (a -> Local) -> [a] -> [Local] -> [a]
231−orderParams f xs ys = orderBy f zs (del zs [] ++ global)
231+orderParams f xs ys = orderBy f zs (del zs [] ++ reserve)
232232 where
233233 zs = orderBy f (sortOn f xs) (nub (ys ++ map f xs))
234234
235235 del _ [] = []
236236 del [] rs = reverse rs
237237 del (r:qs) rs
238− | f r `elem` global = del qs rs
239− | otherwise = del qs (f r:rs)
238+ | f r `elem` reserve = del qs rs
239+ | otherwise = del qs (f r:rs)
240240
241− global =
241+ reserve =
242242 [ "quotaUser"
243243 , "prettyPrint"
244244 , "userIp"
gen/src/Gen/Types/Map.hs−5
@@ -14,9 +14,7 @@
1414module Gen.Types.Map where
1515
1616import Control.Lens
17−import Control.Monad
1817import Data.Aeson
19−import Data.Aeson.Types
2018import Data.Bifunctor
2119import Data.Hashable
2220import qualified Data.HashMap.Strict as Map
@@ -44,6 +42,3 @@ class (Hashable a, Eq a) => TextKey a where
4442instance (TextKey k, FromJSON v) => FromJSON (Map k v) where
4543 parseJSON = fmap (Map.fromList . map (first toKey) . Map.toList)
4644 . parseJSON
47−
48−-- instance (TextKey k, ToJSON v) => ToJSON (Map k v) where
49−-- toJSON = toJSON . map (first fromKey) . Map.toList