mirror of
https://github.com/github/semantic.git
synced 2024-11-25 11:04:00 +03:00
cons
over Source
.
This commit is contained in:
parent
f89b05bb41
commit
b6e05008ec
@ -24,5 +24,8 @@ at = (!!) . unSource
|
||||
null :: Source a -> Bool
|
||||
null (Source vector) = Vector.null vector
|
||||
|
||||
cons :: a -> Source a -> Source a
|
||||
cons a = Source . Vector.cons a . getVector
|
||||
|
||||
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