Skip to content

Instantly share code, notes, and snippets.

@Happy-Ferret
Created May 17, 2014 23:20
Show Gist options
  • Save Happy-Ferret/13df9ccb925e963891ce to your computer and use it in GitHub Desktop.
Save Happy-Ferret/13df9ccb925e963891ce to your computer and use it in GitHub Desktop.
*nix utility skeleton in Haskell
{- Released as "All Rights Reserved"
until further notice/application of a formal license -}
module Main where
import System.Environment
import Control.Monad
import System.Exit
main :: IO ()
main = getArgs >>= parse >>= putStr
parse ["-h"] = help >> exitWith ExitSuccess
parse [] = use >> exitWith ExitSuccess
parse fs = <main functionality>
help = putStrLn "<help text>"
use = putStrLn "<use case>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment