Skip to content

Instantly share code, notes, and snippets.

@Wizek
Last active September 30, 2016 13:02
Show Gist options
  • Save Wizek/91ed67f6fa91888ec6dee2aa1c4e9e4e to your computer and use it in GitHub Desktop.
Save Wizek/91ed67f6fa91888ec6dee2aa1c4e9e4e to your computer and use it in GitHub Desktop.
let x = readFile "./test/IOScenario.hs" >>= lines .> groupByIndentation .>
filter (concat .> words .> (uncons .> maybe False (fst .> ("I" `isSuffixOf`))
`andf` ((!!1) .> (/= "::")))) .> map (unlines .> break (== '=') .> fst .>
(<> "= undefined") .> parseDecs .> fmap (map ((,,) <$> f <*> ppr <*> id))) .>
map fromRight .> concat .> map ((\(a,b,c) -> do print a; print b; print c;
putStrLn "\n")) .> sequence_; f (FunD n [(Clause cs _ _)]) = (show n, map
(let asd = \case VarP a -> show a; ParensP a -> asd a; ConP n [VarP b] | n ==
mkName "Inj" -> show b; _ -> "!!!!!" in asd) cs); f (ValD _ _ _) = ("!!!!", [])
in x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment