Changeset 4 for src/Prim.hs
- Timestamp:
- 02/06/05 20:01:10 (4 years ago)
- svk:copy_cache_prev:
- 1041
- Files:
-
- 1 modified
-
src/Prim.hs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Prim.hs
r1 r4 13 13 14 14 module Prim where 15 import Internals 15 16 import AST 16 import Data.Char17 import Data.Bits18 import Data.Word19 import Data.List20 import Data.Maybe21 import Data.Ratio22 17 23 18 op1 :: Ident -> (forall a. Context a => a) -> Val 24 op1 "!" = VBool . not 19 op1 "!" = \x -> case op1 "?" x of 20 VBool True -> VBool False 21 VBool False -> VBool True 25 22 op1 "+" = op1Numeric id 26 23 op1 "-" = op1Numeric negate … … 154 151 op1Numeric f VUndef = VInt $ f 0 155 152 op1Numeric f (VInt x) = VInt $ f x 153 op1Numeric f (VList l) = VInt $ f $ genericLength l 156 154 op1Numeric f x = VNum $ f (vCast x) 157 155
