Changeset 4158 for src/Pugs/Bind.hs
- Timestamp:
- 05/30/05 10:41:25 (4 years ago)
- svk:copy_cache_prev:
- 5706
- Files:
-
- 1 modified
-
src/Pugs/Bind.hs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Bind.hs
r3906 r4158 180 180 on in the call process. 181 181 -} 182 bindParams :: VCode -- ^ A code object to perform bindings on183 -> (Maybe Exp) -- ^ List of invocants to bind184 -> [Exp] -- ^ List of arguments (actual params) to bind182 bindParams :: VCode -- ^ A code object to perform bindings on 183 -> (Maybe Exp) -- ^ (Optional) explicit invocant 184 -> [Exp] -- ^ List of arguments (actual params) to bind 185 185 -> MaybeError VCode -- ^ Returns either a new 'VCode' with all the 186 186 -- bindings in place, or an error message 187 bindParams sub inv sExp argsExp = do188 case bindSomeParams sub inv sExp argsExp of187 bindParams sub invExp argsExp = do 188 case bindSomeParams sub invExp argsExp of 189 189 Left errMsg -> Left errMsg 190 190 Right boundSub -> finalizeBindings boundSub … … 231 231 parameters bound as possible (using the given invocants and args). 232 232 -} 233 bindSomeParams :: VCode -- ^ Code object to perform bindings on234 -> (Maybe Exp) -- ^ List of invocant expressions235 -> [Exp] -- ^ List of argument expressions233 bindSomeParams :: VCode -- ^ Code object to perform bindings on 234 -> (Maybe Exp) -- ^ Explicit invocant expression 235 -> [Exp] -- ^ List of argument expressions 236 236 -> MaybeError VCode -- ^ A new 'VCode' structure, augmented 237 237 -- with the new bindings 238 bindSomeParams sub inv sExp argsExp = do238 bindSomeParams sub invExp argsExp = do 239 239 let params = subParams sub 240 240 bindings = subBindings sub … … 242 242 (invPrms, argPrms) = span isInvocant params 243 243 (givenInvs, givenArgs) = if null invPrms 244 then ([], (maybeToList inv sExp++argsExp))245 else (maybeToList inv sExp, argsExp)244 then ([], (maybeToList invExp++argsExp)) 245 else (maybeToList invExp, argsExp) 246 246 247 247 let boundInv = invPrms `zip` givenInvs -- invocants are just bound, params to given
