mirror of
https://github.com/github/semantic.git
synced 2025-01-02 20:41:38 +03:00
Revert "Define unName as a function rather than a field selector."
This reverts commit cc049408acc40a560ad85a5d53c776437c99565a.
This commit is contained in:
parent
ed3d8c9e62
commit
4eab7b1cb3
@ -88,7 +88,7 @@ mergeNewer (Environment a) (Environment b) =
|
||||
-- | Extract an association list of bindings from an 'Environment'.
|
||||
--
|
||||
-- >>> pairs shadowed
|
||||
-- [(Name "foo",Address (Precise 1))]
|
||||
-- [(Name {unName = "foo"},Address (Precise 1))]
|
||||
pairs :: Environment location value -> [(Name, Address location value)]
|
||||
pairs = map (second Address) . Map.toList . fold . unEnvironment
|
||||
|
||||
|
@ -8,15 +8,12 @@ import Data.Term
|
||||
import Prologue
|
||||
|
||||
-- | The type of variable names.
|
||||
newtype Name = Name ByteString
|
||||
newtype Name = Name { unName :: ByteString }
|
||||
deriving (Eq, Ord, Show)
|
||||
|
||||
name :: ByteString -> Name
|
||||
name = Name
|
||||
|
||||
unName :: Name -> ByteString
|
||||
unName (Name bytes) = bytes
|
||||
|
||||
instance IsString Name where
|
||||
fromString = Name . BC.pack
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user