diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-10-16 16:23:59 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-10-16 16:23:59 +0300 |
commit | 50aa7bfddc8c1b4b92c227174a9014ec84c02091 (patch) | |
tree | 5fe2ba66fd866c34e88eb146aa3c773742f67327 | |
parent | d3ba2fc3d8721c3f5892c86a3a2f2a0a1e42e231 (diff) | |
download | pandoc-50aa7bfddc8c1b4b92c227174a9014ec84c02091.tar.gz |
Muse reader: simplify "commonPrefix" implementation
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 4cc6b4dff..1507ff2c9 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -139,11 +139,7 @@ parseMuse = do -- * Utility functions commonPrefix :: String -> String -> String -commonPrefix _ [] = [] -commonPrefix [] _ = [] -commonPrefix (x:xs) (y:ys) - | x == y = x : commonPrefix xs ys - | otherwise = [] +commonPrefix xs ys = map fst $ takeWhile (uncurry (==)) $ zip xs ys -- | Trim up to one newline from the beginning of the string. lchop :: String -> String |