Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type Editor = (String, String, String)
- showEditor :: Editor -> String
- showEditor (left, "", right) = left ++ "|" ++ right
- showEditor (left, selection, right) = left ++ "[" ++ selection ++ "]" ++ right
- main = do
- let e = ("hello ", "silly", " world")
- let fileName = "myeditor.txt"
- writeFile fileName (show e)
- contents <- readFile fileName
- let e2 = read contents::Editor
- putStrLn $ showEditor e2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement