Skip to content

Commit 5e5eaaa

Browse files
committed
Cosmetics: unobfuscate accumJPath
(That's just a drive-by shooting.)
1 parent 1543b15 commit 5e5eaaa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Distribution/Server/Framework/HtmlFormWrapper.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,10 @@ parsePathTmpl v = parseKey
181181
parseJVal s = JSON.decode (BS8.pack s)
182182

183183
accumJPaths :: [JPath] -> Maybe JSON.Value
184-
accumJPaths js = foldr (\j r v -> case insertJPath j v of
185-
Nothing -> Nothing
186-
Just v' -> r v') Just js JSON.Null
184+
accumJPaths js = f JSON.Null
185+
where
186+
f :: JSON.Value -> Maybe JSON.Value
187+
f = foldr (\ j r -> insertJPath j >=> r) Just js
187188

188189
insertJPath :: JPath -> JSON.Value -> Maybe JSON.Value
189190
insertJPath (JField f p) JSON.Null = do

0 commit comments

Comments
 (0)