haskell-tools-refactor-1.1.1.0: Refactoring Tool for Haskell

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.Refactor.Utils.Helpers

Description

Helper functions for defining refactorings.

Synopsis

Documentation

removeEmptyBnds :: Simple Traversal Module ValueBind -> Simple Traversal Module Expr -> Module -> Module Source #

Remove the container (where or let) when the last binding is removed.

normalizeElements :: [Ann e dom SrcTemplateStage] -> [Ann e dom SrcTemplateStage] Source #

Puts the elements in the orginal order and remove duplicates (elements with the same source range)

groupElemsBy :: Ord k => (a -> k) -> [a] -> [[a]] Source #

Groups elements together into equivalence groups.

reprElems :: [[a]] -> [(a, [a])] Source #

Chooses a representative element for each equivalence group, and pairs them with their corresponding group.

equivalenceGroupsBy :: Ord k => (a -> k) -> [a] -> [(a, [a])] Source #

Sorts the elements of a list into equivalence groups based on a function, then chooses a representative element for each group, and pairs them with their corresponding group.