Skip to content

Instantly share code, notes, and snippets.

@mmynsted
Created October 24, 2020 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmynsted/da7bc7a118ded64080d87208a0f5c798 to your computer and use it in GitHub Desktop.
Save mmynsted/da7bc7a118ded64080d87208a0f5c798 to your computer and use it in GitHub Desktop.
foo :: Rules UrlPairs
foo = preprocess $ do
xs <- loadUrlMap "redirectLinks.tsv"
case xs of
Left err -> do print err
pure ([] :: UrlPairs)
Right m -> pure m
bar :: Rules ()
bar = do
xs <- foo
let f = arr fromFilePath
ys = fmap (Arrow.first f) xs
createRedirects ys
@MarcelineVQ
Copy link

blop :: Rules ()
blop = do
    xs <- preprocess $ do
      xs <- loadUrlMap "redirectLinks.tsv"
      case xs of
        Left err -> do print err
                       pure ([] :: UrlPairs)
        Right m -> pure m
    let f = arr fromFilePath
        ys = fmap (Arrow.first f) xs
    createRedirects ys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment