Changeset 12422 for src/Pugs/Prim/List.hs
- Timestamp:
- 08/18/06 20:47:21 (2 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Prim/List.hs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/List.hs
r12317 r12422 160 160 op2ReduceL keep list sub = do 161 161 code <- fromVal sub 162 op2Reduce keep list $ VCode code{ subAssoc = "left"}162 op2Reduce keep list $ VCode code{ subAssoc = A_left } 163 163 164 164 op2Reduce :: Bool -> Val -> Val -> Eval Val … … 182 182 evl (App (Val sub) Nothing (map Val xs)) 183 183 case subAssoc code of 184 "right"-> do184 A_right -> do 185 185 let args' = reverse args 186 186 reduceMn args' n (doFold . reverse) 187 "chain"-> if arity /= 2 -- FIXME: incorrect for scans187 A_chain -> if arity /= 2 -- FIXME: incorrect for scans 188 188 then fail 189 189 "When reducing using a chain-associative sub,\nthe sub must take exactly two arguments." … … 196 196 reduceM doFold' (head args) (tail args) 197 197 return $ VBool True 198 "non"-> fail $ "Cannot reduce over non-associativity"198 A_non -> fail $ "Cannot reduce over non-associativity" 199 199 _ -> reduceMn args n doFold -- "left", "pre" 200 200 where
