mirror of
https://github.com/github/semantic.git
synced 2024-11-25 11:04:00 +03:00
Add API to destructure a Source
.
This commit is contained in:
parent
08122476e6
commit
ee91b130e4
@ -23,3 +23,6 @@ at = (!!) . unSource
|
||||
|
||||
null :: Source a -> Bool
|
||||
null (Source vector) = Vector.null vector
|
||||
|
||||
uncons :: Source a -> Maybe (a, Source a)
|
||||
uncons (Source vector) = if Vector.null vector then Nothing else Just (Vector.head vector, Source $ Vector.tail vector)
|
||||
|
Loading…
Reference in New Issue
Block a user