Changeset 2817 for src/Pugs/Bind.hs
- Timestamp:
- 05/07/05 15:48:57 (4 years ago)
- svk:copy_cache_prev:
- 4340
- Files:
-
- 1 modified
-
src/Pugs/Bind.hs (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Bind.hs
r2812 r2817 90 90 91 91 -- |Return @True@ if the given expression represents a pair (i.e. it uses the 92 -- \"=>\" pair co mposer).92 -- \"=>\" pair constructor). 93 93 isPair :: Exp -> Bool 94 94 isPair (Pos _ exp) = isPair exp … … 109 109 unPair x = error ("Not a pair: " ++ show x) 110 110 111 -- performs a binding and then verifies that it's complete in one go112 111 {-| 113 112 Bind parameters to a callable, then verify that the binding is complete … … 115 114 bindings). Uses 'bindSomeParams' to perform the initial binding, then uses 116 115 'finalizeBindings' to check all required params and give default values to 117 any unbound optional ones. 116 any unbound optional ones. Once this is complete, /everything/ should be 117 bound. 118 118 -} 119 119 bindParams :: VCode -- ^ A code object to perform bindings on … … 127 127 Right boundSub -> finalizeBindings boundSub 128 128 129 -- verifies that all invocants and required params were given 130 -- and binds default values to unbound optionals 129 {-| 130 Verify that all invocants and required parameters are bound, and give default 131 values to any unbound optional parameters. 132 -} 131 133 finalizeBindings :: VCode -> MaybeError VCode 132 134 finalizeBindings sub = do … … 161 163 } 162 164 163 -- takes invocants and arguments, and creates a binding from the remaining params in the sub164 165 {-| 165 166 Take a code object and lists of invocants and arguments, and produce (if … … 167 168 parameters bound as possible (using the given invocants and args). 168 169 -} 169 bindSomeParams :: VCode -> [Exp] -> [Exp] -> MaybeError VCode 170 bindSomeParams :: VCode -- ^ Code object to perform bindings on 171 -> [Exp] -- ^ List of invocant expressions 172 -> [Exp] -- ^ List of argument expressions 173 -> MaybeError VCode -- ^ A new 'VCode' structure, augmented 174 -- with the new bindings 170 175 bindSomeParams sub invsExp argsExp = do 171 176 let params = subParams sub
