ubuntuusers.de

ubuntuusers.deAblageidea to make code more simple.
Titel:
idea to make code more simple.
Datum:
24. Februar 2011 19:36
Aktionen:
Code:
1
2
3
4
5
6
let check = do when (null args) $ Left "No arguments given. See --help for more info."
               when (length params > 1) $ Left ("No arguments given for " ++ param)
               return (param,pArgs)
               where (params@(param:_),rest) = span (\(c:_) -> c=='-') args
                     (pArgs,_) = span (\(c:_) -> c/='-') rest