git.iko.soy/typeable/pandoc
on master help sign in
Avoid non-exhaustive pattern match.
84e0b90John MacFarlane
src/Text/Pandoc/Readers/Odt/Generic/Utils.hs+1−3
@@ -133,9 +133,7 @@ class Lookupable a where
133-- can be used directly in almost any case.
133-- can be used directly in almost any case.
134readLookupables :: (Lookupable a) => String -> [(a,String)]
134readLookupables :: (Lookupable a) => String -> [(a,String)]
135readLookupables s = [ (a,rest) | (word,rest) <- lex s,
135readLookupables s = [ (a,rest) | (word,rest) <- lex s,
136− let result = lookup word lookupTable,
136+ a <- maybeToList (lookup word lookupTable)
137− isJust result,
138− let Just a = result
139 ]
137 ]
140
138
141-- | Very similar to a simple 'lookup' in the 'lookupTable', but with a lexer.
139-- | Very similar to a simple 'lookup' in the 'lookupTable', but with a lexer.