Report a paste

Please put a quick comment for the admin.

If it looks like spam, the admin will mark it as spam so that the spam filter picks it up in the future.

If the paste contains something private or offensive, it'll probably just be deleted.

uniplate is being weird

travMD :: Traversal' CompilationUnit MemberDecl
travMD = cuTDecls . traverse . tdClass . cdBody . cbDecls . traverse . declMem

execVDTop :: NormArrT IO CompilationUnit
execVDTop = travMD . mdBlock.bStmts %%~ vdMove

u = undefined

vdMove :: NormArrT IO [Stmt]
vdMove ss = do
  let (ssF, ssT) = runWriter (vdSteal ss)
  io $ do
    hcPrint ss
    putStrLn $ replicate 80 '-'
    hcPrint ssF
    putStrLn $ replicate 80 '-'
    hcPrint ssT
    putStrLn $ replicate 80 '-'
    hcPrint $ ssT `isPrefixOf` ss
  {-
  -}
  (if ssT `isPrefixOf` ss then unique else change) $ ssT ++ ssF

vdSteal :: [Stmt] -> Writer [Stmt] [Stmt]
vdSteal = normEvery $ filterM $ \s ->
  maybe (pure True) (const $ tell [s] >> pure False) $
        extTVD s >>= ensureMovable