1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 05:11:44 +03:00

Docs, function ordering

This commit is contained in:
Timothy Clem 2018-03-15 12:29:46 -07:00
parent 92b383cf45
commit 5dfb19cd29

View File

@ -20,16 +20,16 @@ name x = x :| []
qualifiedName :: [ByteString] -> Name
qualifiedName = NonEmpty.fromList
-- | Construct a qualified 'Name' from a `/` delimited path.
pathToQualifiedName :: ByteString -> Name
pathToQualifiedName = qualifiedName . splitOnPathSeparator
-- | Split a 'ByteString' path on `/`, stripping quotes and any `./` prefix.
splitOnPathSeparator :: ByteString -> [ByteString]
splitOnPathSeparator = BC.split '/' . BC.dropWhile (== '/') . BC.dropWhile (== '.') . stripQuotes
where stripQuotes = B.filter (/= fromIntegral (ord '\"'))
-- | Construct a qualified 'Name' from a `/` delimited path.
pathToQualifiedName :: ByteString -> Name
pathToQualifiedName = qualifiedName . splitOnPathSeparator
-- | User friendly version of a qualified 'Name'.
-- | User friendly 'ByteString' of a qualified 'Name'.
friendlyName :: Name -> ByteString
friendlyName xs = intercalate "." (NonEmpty.toList xs)