[Haskell-beginners] getopt

Stephen Tetley stephen.tetley at gmail.com
Thu Aug 5 16:14:44 EDT 2010


input, output and verbose are bindings introduced by pattern matching
within the let clause.

The Options datatype has field labels optVerbose, optInput and optOutput:

data Options = Options  { optVerbose    :: Bool
                        , optInput      :: IO String
                        , optOutput     :: String -> IO ()
                        }

Pattern matching can elide field labels, this let binding is equivalent:

 let (Options verbose input output) = opts


More information about the Beginners mailing list