giml-language-0.1.0.0: A purely functional programming language with emphasis on structural typing
Safe HaskellSafe-Inferred
LanguageGHC2021

Language.Giml.Rewrites.PreInfer.CheckDuplicates

Description

Check for duplicate names

We want to make sure the user does not write the same argument name twice in a give anonymous function, function definition, type definition, and variants names.

We also do not want the same name in pattern captures. (This is not datalog/prolog yet!)

Synopsis

Documentation

rewrite :: MonadError PreInferError m => ParsedFile Ann -> m (ParsedFile Ann) Source #

Check for duplicate names in a File.

rewrite' :: forall f m. MonadError PreInferError m => Data (f Ann) => f Ann -> m (f Ann) Source #

duplicates :: Ord b => (a -> b) -> [a] -> [[a]] Source #

groupOn :: Eq b => (a -> b) -> [a] -> [[a]] Source #