[Modified some stuff. nad**20040616115918] { hunk ./ChasingBottoms/SemanticOrd.hs 3 --- | Generic semantic equality and order. The implementation is based --- on 'isBottom', and has the same limitations. Note that non-bottom --- functions are not handled by any of the functions described below. +-- | Generic semantic equality and order. The semantic order referred +-- to is that of a typical CPO for Haskell types, where e.g. @('True', +-- 'bottom') '<=!' ('True', 'False')@, but where @('True', 'True')@ +-- and @('True', 'False')@ are incomparable. +-- +-- The implementation is based on 'isBottom', and has the same +-- limitations. Note that non-bottom functions are not handled by any +-- of the functions described below. hunk ./ChasingBottoms/SemanticOrd.hs 20 --- import Debug.QuickCheck hunk ./ChasingBottoms/SemanticOrd.hs 41 --- We can't implement compare/min/max. Possible interesting --- variations: lub, glb :: a -> a -> Maybe a, semanticCompare :: a -> --- a -> Maybe Ordering. - hunk ./ChasingBottoms/SemanticOrd.hs 50 - -- | @x '\/!' y@ and @x '/\!' y@ compute the least upper and greatest + (/\!) :: a -> a -> a + -- ^ @x '\/!' y@ and @x '/\!' y@ compute the least upper and greatest hunk ./ChasingBottoms/SemanticOrd.hs 58 - (/\!) :: a -> a -> a hunk ./ChasingBottoms/SemanticOrd.hs 73 - (/\!) = \x y -> x /\!! y - (\/!) = \x y -> x \/!! y + (/\!) = (/\!!) + (\/!) = (\/!!) hunk ./ChasingBottoms/SemanticOrd.hs 118 - -- This should be possible, in some framework, but I don't know - -- how to do it just yet. - -- cast' (\x -> cast' a x /\!! cast' b x) :: b hunk ./ChasingBottoms/SemanticOrd.hs 132 - -- This should be possible, in some framework, but I don't - -- know how to do it. - -- cast (\x -> cast' a x \/! cast' b x) :: Maybe b hunk ./ChasingBottoms/SemanticOrd.hs 136 -tmkM :: (Typeable a, Typeable b, Typeable c, Monad m) => - (a -> b -> m b) -> a -> c -> m c -tmkM f x y = mkM (f x) y - -cast' :: (Typeable a, Typeable b) => a -> b -cast' = Maybe.fromJust . cast - hunk ./ChasingBottoms/SemanticOrd.hs 139 - --- GenericQ (GenericQ r) = forall a b . (Data a, Data b) => a -> b -> r - --- tmapQl :: (r -> r -> r) -> r -> GenericQ (GenericQ r) -> GenericQ (GenericQ r) - --- everywhere :: (forall a . Data a => a -> a) -> forall a . Data a => a -> a --- everywhere f = f . gmapT (everywhere f) - --- gmapT :: Data a => (forall b . Data b => b -> b) -> a -> a - --- teverywhere :: (forall a . Data a => a -> a) -> --- (forall a . Data a => a -> a) -> --- forall a . Data a => a -> --- forall a . Data a => a -> --- a --- teverywhere }