Changeset 3328 for src/Pugs/Bind.hs

Show
Ignore:
Timestamp:
05/17/05 11:33:37 (4 years ago)
Author:
scook0
svk:copy_cache_prev:
4908
Message:

Style updates for Haddocks

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Bind.hs

    r3145 r3328  
    1515import Pugs.Types 
    1616 
    17 -- |Contains either a valid value of @a@ (@Right@), or a @String@ error 
    18 -- message (@Left@). 
     17{-| 
     18Contains either a valid value of @a@ (@Right@), or a @String@ error 
     19message (@Left@). 
     20-} 
    1921type MaybeError a = Either String a 
    2022 
     23isRequired :: Param -> Bool 
    2124isRequired prm = not ( isOptional prm || isNamed prm ) 
    2225 
    23 -- |Match up named arguments with named parameters, producing a list of new 
    24 -- bindings, and lists of remaining unbound args and params. 
     26{-| 
     27Match up named arguments with named parameters, producing a list of new 
     28bindings, and lists of remaining unbound args and params. 
     29-} 
    2530bindNames :: [Exp] -- ^ List of argument expressions to be bound 
    2631          -> [Param] -- ^ List of parameters to try binding; includes both 
     
    9499    prms = map (\p -> (p, (head (paramName p)))) ps  
    95100 
    96 -- |Construct an expression representing an infinite slice of the given 
    97 -- array expression, beginning at element /n/ (i.e. @\@array\[\$n...\]@). 
    98 -- Used by 'doBindArray' to bind a slurpy array parameter to the rest of 
    99 -- the slurpable arguments. 
     101{-| 
     102Construct an expression representing an infinite slice of the given 
     103array expression, beginning at element /n/ (i.e. @\@array\[\$n...\]@). 
     104 
     105Used by 'doBindArray' to bind a slurpy array parameter to the rest of 
     106the slurpable arguments. 
     107-} 
    100108doSlice :: Exp -- ^ The array expression to slice 
    101109        -> VInt -- ^ Index of the first element in the resulting slice (/n/) 
     
    104112 
    105113-- XXX - somehow force failure 
    106 -- |Construct an expression representing element /n/ in the given array 
    107 -- expression (i.e. @\@array\[\$n\]@). Used by 'doBindArray' to bind a 
    108 -- particular slurpy scalar parameter to one of the slurpable arguments. 
     114{-| 
     115Construct an expression representing element /n/ in the given array 
     116expression (i.e. @\@array\[\$n\]@). 
     117 
     118Used by 'doBindArray' to bind a particular slurpy scalar parameter to one of  
     119the slurpable arguments. 
     120-} 
    109121doIndex :: Exp -> VInt -> Exp 
    110122doIndex v n = Syn "[]" [Syn "val" [v], Val $ VInt n] 
     
    119131doBindArray _ (_, _)  (_, x) = internalError $ "doBindArray: unexpected char: " ++ (show x) 
    120132 
    121 -- |(Does this even get used? It seems to be a leftover fragment of 
    122 -- 'doBindArray'...) 
     133{-| 
     134(Does this even get used? It seems to be a leftover fragment of  
     135'doBindArray'...) 
     136-} 
    123137bindEmpty :: Param -> MaybeError (Param, Exp) 
    124138bindEmpty p = case paramName p of 
     
    128142    []      -> internalError $ "bindEmpty: empty string encountered" 
    129143 
    130 -- |Return @True@ if the given expression represents a pair (i.e. it uses the 
    131 -- \"=>\" pair constructor). 
     144{-| 
     145Return @True@ if the given expression represents a pair (i.e. it uses the 
     146\"=>\" pair constructor). 
     147-} 
    132148isPair :: Exp -> Bool 
    133149isPair (Pos _ exp) = isPair exp 
     
    138154isPair _                         = False 
    139155 
    140 -- |Decompose a pair-constructor 'Exp'ression (\"=>\") into a Haskell pair 
    141 -- (@key :: 'String'@, @value :: 'Exp'@). 
     156{-| 
     157Decompose a pair-constructor 'Exp'ression (\"=>\") into a Haskell pair 
     158(@key :: 'String'@, @value :: 'Exp'@). 
     159-} 
    142160unPair :: Exp -> (String, Exp) 
    143161unPair (Pos _ exp) = unPair exp 
     
    151169Bind parameters to a callable, then verify that the binding is complete 
    152170(i.e. all mandatory params are bound; all unspecified params have default 
    153 bindings). Uses 'bindSomeParams' to perform the initial binding, then uses 
     171bindings). 
     172 
     173Uses 'bindSomeParams' to perform the initial binding, then uses 
    154174'finalizeBindings' to check all required params and give default values to 
    155175any unbound optional ones. Once this is complete, /everything/ should be