1
1
mirror of https://github.com/github/semantic.git synced 2025-01-04 13:34:31 +03:00

documentation

This commit is contained in:
Patrick Thomson 2018-03-12 14:24:36 -04:00
parent e8c7389ffe
commit dfc4d786e5

View File

@ -29,10 +29,11 @@ type ValueConstructors location term
newtype Value location term = Value { deValue :: Union (ValueConstructors location term) (Value location term) }
deriving (Eq, Show, Ord)
-- | Identical to 'inj', but wraps the resulting sub-entity in a 'Value'.
injValue :: (f :< ValueConstructors location term) => f (Value location term) -> Value location term
injValue = Value . inj
-- | Identical to 'prj', but unwraps the argument out of its 'Value' wrapper.
prjValue :: (f :< ValueConstructors location term) => Value location term -> Maybe (f (Value location term))
prjValue = prj . deValue