mirror of
https://github.com/github/semantic.git
synced 2024-12-29 01:42:43 +03:00
Define a helper to extract the User name from a Named value.
This commit is contained in:
parent
906eba62f0
commit
daa280c300
@ -4,6 +4,7 @@ module Data.Name
|
||||
, Namespaced
|
||||
, Name(..)
|
||||
, Named(..)
|
||||
, namedName
|
||||
, reservedNames
|
||||
, isSimpleCharacter
|
||||
, needsQuotation
|
||||
@ -73,6 +74,9 @@ data Named a = Named User a
|
||||
instance Eq a => Eq (Named a) where (==) = (==) `on` namedValue
|
||||
instance Ord a => Ord (Named a) where compare = compare `on` namedValue
|
||||
|
||||
namedName :: Named a -> User
|
||||
namedName (Named n _) = n
|
||||
|
||||
namedValue :: Named a -> a
|
||||
namedValue (Named _ a) = a
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user