mirror of
https://github.com/github/semantic.git
synced 2024-12-25 16:02:43 +03:00
Prettier output for machine-generated names.
This commit is contained in:
parent
f49ba195cf
commit
40b1d2030b
@ -26,7 +26,9 @@ nameI = I
|
||||
-- | Extract a human-readable 'ByteString' from a 'Name'.
|
||||
unName :: Name -> ByteString
|
||||
unName (Name name) = name
|
||||
unName (I i) = BC.pack (show i)
|
||||
unName (I i) = BC.pack $ '_' : (alphabet !! a) : replicate n 'ʹ'
|
||||
where alphabet = ['a'..'z']
|
||||
(n, a) = i `divMod` length alphabet
|
||||
|
||||
instance IsString Name where
|
||||
fromString = Name . BC.pack
|
||||
|
Loading…
Reference in New Issue
Block a user