Changeset 15296 for src/Pugs/Val

Show
Ignore:
Timestamp:
02/18/07 15:56:10 (21 months ago)
Author:
audreyt
Message:

* Convert VStr from String to ByteString?, and Syn from

String to ID, in Pugs. Benchmark shows the perf gain is 5%,
so it's not worth the trouble of writing a GHC 6.7-compatible
processor. The next commit will revert this commit.

Location:
src/Pugs/Val
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Val/Base.hs

    r15096 r15296  
    2525    asNum x = fail $ "coerce fail: " ++ (show $ typeOf x) ++ " to PureNum" 
    2626    asStr    :: a -> m PureStr 
    27     asStr _ = return (cast "<opaque>") -- XXX wrong 
     27    asStr _ = return (_cast "<opaque>") -- XXX wrong 
    2828    -- "$item = VAL" 
    2929    asItem   :: a -> Maybe (m Val) 
     
    7878instance ICoercible P PureInt where 
    7979    asInt = return . cast 
    80     asStr INotANumber           = cast "NaN" 
    81     asStr (IInfinite SPositive) = cast "Inf" 
    82     asStr (IInfinite SNegative) = cast "-Inf" 
     80    asStr INotANumber           = _cast "NaN" 
     81    asStr (IInfinite SPositive) = _cast "Inf" 
     82    asStr (IInfinite SNegative) = _cast "-Inf" 
    8383    asStr (IFinite n)           = cast (show n) 
    8484    asNum INotANumber           = return $ cast ( (0/0) :: Double) 
  • src/Pugs/Val/Code.hs

    r13494 r15296  
    223223 
    224224instance ICoercible P ValCapt where 
    225         asStr _ = return (cast "<capt>") -- XXX 
    226  
     225        asStr _ = return (_cast "<capt>") -- XXX 
     226