Created
August 5, 2017 13:06
-
-
Save beckyconning/fbc7bf4c0ce9c3c887ea7f782ed81c22 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module Codewars.Kata.Dubstep where | |
import Prelude | |
import Control.Monad (join) | |
import Data.List | |
import Data.Text (strip, pack, unpack) | |
import Text.Parsec | |
songDecoder :: String -> String | |
songDecoder = | |
either show (unpack . strip . pack) | |
. parse | |
(join <$> many (many1 (try (string "WUB")) *> pure " " <|> fmap pure anyChar)) | |
"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment