import System.IO import Control.Monad type Node = Prelude.String -- singleton inductive, whose constructor was Node node_rect :: (Prelude.String -> a1) -> Node -> a1 node_rect f = f data Edge0 = Edge Node Node Node deriving Show e1 :: Edge0 -> Node e1 e = case e of { Edge e4 _ _ -> e4} e2 :: Edge0 -> Node e2 e = case e of { Edge _ e4 _ -> e4} e3 :: Edge0 -> Node e3 e = case e of { Edge _ _ e4 -> e4} prompt :: String -> IO String prompt text = do putStr text hFlush stdout getLine readData :: String -> IO String readData fn = do content <- readFile (fn ++ ".txt") return content processData :: String -> IO ([String]) processData c = do let out = lines c return out consE :: [String] -> Edge0 consE [x, y, z] = Edge x y z pT :: String -> IO ([Edge0]) pT str = do d <- readData str let out1 = lines d let out2 = map words out1 let out3 = map consE out2 --print out3 return out3 {-- parseTriples :: String -> IO ([String]) parseTriples str = do d <- readData str out <- processData d return out --} {-- map words out --}