Changeset 3906 for src/Pugs/Bind.hs
- Timestamp:
- 05/26/05 12:37:22 (4 years ago)
- svk:copy_cache_prev:
- 5482
- Files:
-
- 1 modified
-
src/Pugs/Bind.hs (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Bind.hs
r3565 r3906 150 150 isPair (Cxt _ exp) = isPair exp 151 151 isPair (Syn "=>" [(Val _), _]) = True 152 isPair (App (Var "&infix:=>") [(Cxt _ (Val _)), _] []) = True153 isPair (App (Var "&infix:=>") [(Val _), _] []) = True152 isPair (App (Var "&infix:=>") Nothing [(Cxt _ (Val _)), _]) = True 153 isPair (App (Var "&infix:=>") Nothing [(Val _), _]) = True 154 154 isPair _ = False 155 155 … … 162 162 unPair (Cxt _ exp) = unPair exp 163 163 unPair (Syn "=>" [(Val k), exp]) = (vCast k, exp) 164 unPair (App (Var "&infix:=>") [(Cxt _ (Val k)), exp] []) = (vCast k, exp)165 unPair (App (Var "&infix:=>") [(Val k), exp] []) = (vCast k, exp)164 unPair (App (Var "&infix:=>") Nothing [(Cxt _ (Val k)), exp]) = (vCast k, exp) 165 unPair (App (Var "&infix:=>") Nothing [(Val k), exp]) = (vCast k, exp) 166 166 unPair x = error ("Not a pair: " ++ show x) 167 167 … … 181 181 -} 182 182 bindParams :: VCode -- ^ A code object to perform bindings on 183 -> [Exp]-- ^ List of invocants to bind183 -> (Maybe Exp) -- ^ List of invocants to bind 184 184 -> [Exp] -- ^ List of arguments (actual params) to bind 185 185 -> MaybeError VCode -- ^ Returns either a new 'VCode' with all the … … 232 232 -} 233 233 bindSomeParams :: VCode -- ^ Code object to perform bindings on 234 -> [Exp]-- ^ List of invocant expressions234 -> (Maybe Exp) -- ^ List of invocant expressions 235 235 -> [Exp] -- ^ List of argument expressions 236 236 -> MaybeError VCode -- ^ A new 'VCode' structure, augmented … … 242 242 (invPrms, argPrms) = span isInvocant params 243 243 (givenInvs, givenArgs) = if null invPrms 244 then ([], ( invsExp++argsExp))245 else ( invsExp, argsExp)244 then ([], (maybeToList invsExp++argsExp)) 245 else (maybeToList invsExp, argsExp) 246 246 247 247 let boundInv = invPrms `zip` givenInvs -- invocants are just bound, params to given
