Skip to content

Instantly share code, notes, and snippets.

@beckyconning
Created August 5, 2017 13:06
Show Gist options
  • Save beckyconning/fbc7bf4c0ce9c3c887ea7f782ed81c22 to your computer and use it in GitHub Desktop.
Save beckyconning/fbc7bf4c0ce9c3c887ea7f782ed81c22 to your computer and use it in GitHub Desktop.
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