Last active
March 7, 2017 21:39
-
-
Save Sh4pe/e23cd57fdcd32aaab428cc93465f8542 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
concatLeft :: Char -> C.ByteString -> C.ByteString | |
concatLeft delim a = go $ C.uncons a | |
where bsa = C.singleton delim | |
go Nothing = bsa | |
go (Just (delim, r)) = concatLeft delim r | |
go (Just (x, r)) = C.concat [bsa, r] | |
-- Warning: | |
-- Pattern match(es) are overlapped | |
-- In an equation for ‘go’: go (Just (x, r)) = ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment