# Pastebin bqRX0wdr runSedxAndReplace :: String -> String -> IO ByteString runSedxAndReplace sedxFile sedInput = do prog <- either (fail . errorBundlePretty) pure =<< (parse pProgram sedInput <$> readFile sedxFile) input <- readFile sedInput BC.pack <$> readProcess "sed" ["-e", printMatchAndSub prog] input