1
1
mirror of https://github.com/github/semantic.git synced 2024-12-11 08:45:48 +03:00

Express HasErrors at * -> *.

This commit is contained in:
Rob Rix 2019-10-18 15:59:52 -04:00
parent 70bbffc827
commit fa34b0bab0
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -214,9 +214,9 @@ instance Ord ErrorStack where
class HasErrors term where
getErrors :: term -> [Error.Error String]
getErrors :: term Loc -> [Error.Error String]
instance (Error :< fs, Apply Foldable fs, Apply Functor fs) => HasErrors (Term (Sum fs) Loc) where
instance (Error :< fs, Apply Foldable fs, Apply Functor fs) => HasErrors (Term (Sum fs)) where
getErrors = cata $ \ (In Loc{..} syntax) ->
maybe (fold syntax) (pure . unError span) (Data.Sum.project syntax)