mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
Add a maybeGetField function over Records.
This commit is contained in:
parent
e50b1a5f61
commit
107077c493
@ -19,6 +19,10 @@ infixr 0 .:
|
||||
(.:) :: Typeable h => h -> Record t -> Record (h ': t)
|
||||
(.:) = RCons
|
||||
|
||||
maybeGetField :: Typeable field => Record fields -> Maybe field
|
||||
maybeGetField (RCons h t) = cast h <|> maybeGetField t
|
||||
maybeGetField RNil = Nothing
|
||||
|
||||
|
||||
-- Classes
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user