{-# OPTIONS_GHC -cpp #-} {- demonstrating the use of ReifyHs.reify -} module Main where import ReifyHs (reify) import PrettyGraph (prettyGraph) import Data.Char (toUpper) main :: IO () main = do putStrLn $ "GHC version: " ++ show __GLASGOW_HASKELL__ let listTups = zip "abcdefghij" [1..] putStr "\n\nForce the list to be evaluated a bit:\n\n" print $ take 3 listTups graph <- reify listTups putStr "\n\nhere's the graph representation: \n\n" print graph putStr "\n\nhere's a pretty print of the above: \n\n" putStrLn $ prettyGraph graph putStr "\n\nForce the list to be evaluated a bit more:\n\n" print $ take 5 listTups graph <- reify listTups putStr "\n\nthe graph pretty printed again: \n\n" putStrLn $ prettyGraph graph