mirror of
https://github.com/kazu-yamamoto/dns.git
synced 2024-10-05 18:17:09 +03:00
updating doc
This commit is contained in:
parent
95f80e2777
commit
3b406912b7
@ -28,11 +28,14 @@ class (Typeable a, Eq a, Show a) => ResourceData a where
|
||||
|
||||
---------------------------------------------------------------
|
||||
|
||||
-- | A type to uniform 'ResourceData' 'a'.
|
||||
data RData = forall a . (Typeable a, Eq a, Show a, ResourceData a) => RData a
|
||||
|
||||
-- | Extracting the original type.
|
||||
fromRData :: Typeable a => RData -> Maybe a
|
||||
fromRData (RData x) = cast x
|
||||
|
||||
-- | Wrapping the original type with 'RData'.
|
||||
toRData :: (Typeable a, ResourceData a) => a -> RData
|
||||
toRData = RData
|
||||
|
||||
@ -42,6 +45,7 @@ instance Show RData where
|
||||
instance Eq RData where
|
||||
x@(RData xi) == y@(RData yi) = typeOf x == typeOf y && Just xi == cast yi
|
||||
|
||||
-- | Getting 'TYPE' of 'RData'.
|
||||
rdataType :: RData -> TYPE
|
||||
rdataType (RData x) = resourceDataType x
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user