Skip to content

Instantly share code, notes, and snippets.

@mizunashi-mana
Created June 5, 2017 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mizunashi-mana/e8a1ac7a857df8a1d3a13b145b98e16d to your computer and use it in GitHub Desktop.
Save mizunashi-mana/e8a1ac7a857df8a1d3a13b145b98e16d to your computer and use it in GitHub Desktop.
ed :: [String] -> IO ()
ed args = if null args
then do
x <- fromMaybe "" <$> runInputT defaultSettings (getInputLine "")
ed' (setCmd x) [] [] 1 True
else do
x <- createBuffer (head args)
y <- fromMaybe "" <$> runInputT defaultSettings (getInputLine "")
ed' (setCmd y) (head args) x 1 True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment