Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
contains :: Ann -> Pos -> Bool Source #
Checks whether an annotation contains a given position i.e. pos ∈ [start, end)
>>>
Intrinsic `contains` L.Pos 1 1
False
>>>
External `contains` L.Pos 1 1
False
>>>
Ann (L.Pos 0 0) (L.Pos 0 10) `contains` L.Pos 0 5
True
>>>
Ann (L.Pos 0 0) (L.Pos 0 10) `contains` L.Pos 0 10
False
encompasses :: Ann -> Ann -> Maybe Bool Source #
Checks whether an annotation contains another annotation.
i.e. pos ∈ [start, end)
>>>
Intrinsic `encompasses` Ann (L.Pos 1 1) (L.Pos 2 1)
Nothing
>>>
External `encompasses` Ann (L.Pos 1 1) (L.Pos 2 1)
Nothing
>>>
Ann (L.Pos 0 0) (L.Pos 0 10) `encompasses` Ann (L.Pos 0 1) (L.Pos 0 5)
Just True
>>>
Ann (L.Pos 1 0) (L.Pos 1 10) `encompasses` Ann (L.Pos 0 0) (L.Pos 2 0)
Just False
class Annotated a where Source #
Instances
Annotated Void Source # | |
Annotated Ann Source # | |
Annotated a => Annotated (NonEmpty a) Source # | |
Annotated a => Annotated (Pattern a) Source # | |
Annotated (Token a) Source # | |
Annotated a => Annotated (Maybe a) Source # | |
Annotated a => Annotated [a] Source # | |
Defined in Unison.Parser.Ann | |
Annotated a => Annotated (Cofree f a) Source # | |
(Annotated a, Annotated b) => Annotated (MatchCase a b) Source # | |
Annotated a => Annotated (Term f v a) Source # | |