Changeset 5493 for src/Pugs/Internals.hs

Show
Ignore:
Timestamp:
07/12/05 14:34:10 (3 years ago)
Author:
autrijus
svk:copy_cache_prev:
7501
Message:

* identity test for functions should now pass; Eq and Ord

for function and dynamics redefined to base on 'show'.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Internals.hs

    r5291 r5493  
    134134        typA = show $ typeOf (undefined :: a) 
    135135        typB = show $ typeOf (undefined :: b) 
    136 instance Eq (a -> b) where 
    137     _ == _ = False 
    138 instance Ord (a -> b) where 
    139     compare _ _ = LT 
     136instance (Typeable a, Typeable b) => Eq (a -> b) where 
     137    x == y = show x == show y 
     138instance (Typeable a, Typeable b) => Ord (a -> b) where 
     139    compare x y = compare (show x) (show y) 
    140140instance Eq Dynamic where 
    141     _ == _ = False 
     141    x == y = show x == show y 
    142142instance Ord Dynamic where 
    143     compare _ _ = LT 
     143    compare x y = compare (show x) (show y) 
    144144 
    145145internalError :: String -> a