mirror of
https://github.com/github/semantic.git
synced 2024-12-21 22:01:46 +03:00
Define the Eq1, Ord1, & Show1 instances for Address in terms of Eq, Ord, & Show on the location.
This commit is contained in:
parent
e9095c3558
commit
8db812f865
@ -8,11 +8,11 @@ import Prologue
|
||||
|
||||
-- | An abstract address with a @location@ pointing to a variable of type @value@.
|
||||
newtype Address location value = Address { unAddress :: location }
|
||||
deriving (Eq, Generic1, Ord, Show)
|
||||
deriving (Eq, Ord, Show)
|
||||
|
||||
instance Eq location => Eq1 (Address location) where liftEq = genericLiftEq
|
||||
instance Ord location => Ord1 (Address location) where liftCompare = genericLiftCompare
|
||||
instance Show location => Show1 (Address location) where liftShowsPrec = genericLiftShowsPrec
|
||||
instance Eq location => Eq1 (Address location) where liftEq _ a b = unAddress a == unAddress b
|
||||
instance Ord location => Ord1 (Address location) where liftCompare _ a b = unAddress a `compare` unAddress b
|
||||
instance Show location => Show1 (Address location) where liftShowsPrec _ _ = showsPrec
|
||||
|
||||
|
||||
class Location location where
|
||||
|
Loading…
Reference in New Issue
Block a user