git.iko.soy/typeable/schematic
on master help sign in
Fix warning about shadowed 'demote'
commit7b965a31d456c69237c9340270f3f93ffd07908b authorDmitry Bushev <bushevdv@gmail.com> dateTue 10 Jul 2018, 09:47 (8 years ago) parent5955c51
1 file changed+4−5
src/Data/Schematic/Path.hs+4−5
src/Data/Schematic/Path.hs+4−5
@@ -2,7 +2,6 @@ module Data.Schematic.Path where
22
33import Data.Foldable as F
44import Data.Monoid
5−import Data.Singletons
65import Data.Singletons.Prelude
76import Data.Singletons.TypeLits
87import Data.Text as T
@@ -26,10 +25,10 @@ demotePath = go []
2625 where
2726 go :: [DemotedPathSegment] -> Sing (ps :: [PathSegment]) -> [DemotedPathSegment]
2827 go acc SNil = acc
29− go acc (SCons p ps) = go (acc ++ [demote p]) ps
30− demote :: Sing (ps :: PathSegment) -> DemotedPathSegment
31− demote (SKey s) = DKey $ T.pack $ withKnownSymbol s $ symbolVal s
32− demote (SIx n) = DIx $ withKnownNat n $ fromIntegral $ natVal n
28+ go acc (SCons p ps) = go (acc ++ [demotePathSeg p]) ps
29+ demotePathSeg :: Sing (ps :: PathSegment) -> DemotedPathSegment
30+ demotePathSeg (SKey s) = DKey $ T.pack $ withKnownSymbol s $ symbolVal s
31+ demotePathSeg (SIx n) = DIx $ withKnownNat n $ fromIntegral $ natVal n
3332
3433demotedPathToText :: [DemotedPathSegment] -> JSONPath
3534demotedPathToText = JSONPath . F.foldl' renderPathSegment ""