Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import System.IO
- import System.Environment
- import Data.List
- main = do
- args <- getArgs
- let fsm = if length args == 0
- then
- readStdin
- else
- readFromFile "fsm.txt"
- putStr fsm
- readStdin:: String
- readStdin = do
- contents <- getContents
- return contents
- readFromFile :: String -> String
- readFromFile fileName = do
- handle <- openFile filename ReadMode
- contents <-hGetContents hadle
- hClose handle
- return contents
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement