Changeset 10616 for src/Pugs/Prim/Numeric.hs
- Timestamp:
- 06/11/06 16:21:32 (2 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Prim/Numeric.hs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/Numeric.hs
r10531 r10616 16 16 | VUndef <- x = op2Numeric f (VInt 0) y 17 17 | VUndef <- y = op2Numeric f x (VInt 0) 18 | VType{} <- x = op2Numeric f (VInt 0) y 19 | VType{} <- y = op2Numeric f x (VInt 0) 18 20 | (VInt x', VInt y') <- (x, y) = return $ VInt $ f x' y' 19 21 | (VRat x', VInt y') <- (x, y) = return $ VRat $ f x' (y' % 1) … … 46 48 op1Numeric :: (forall a. (Num a) => a -> a) -> Val -> Eval Val 47 49 op1Numeric f VUndef = return . VInt $ f 0 50 op1Numeric f VType{} = return . VInt $ f 0 48 51 op1Numeric f (VInt x) = return . VInt $ f x 49 52 op1Numeric f l@(VList _)= fmap (VInt . f) (fromVal l)
