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

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.Refactor.BindingElem

Description

Utilities for transformations that work on both top-level and local definitions

Synopsis

Documentation

class NamedElement d => BindingElem d where Source #

A type class for handling definitions that can appear as both top-level and local definitions

Methods

sigBind :: Simple Partial (Ann d dom SrcTemplateStage) (TypeSignature dom) Source #

Accesses a type signature definition in a local or top-level definition

valBind :: Simple Partial (Ann d dom SrcTemplateStage) (ValueBind dom) Source #

Accesses a value or function definition in a local or top-level definition

createTypeSig :: TypeSignature dom -> Ann d dom SrcTemplateStage Source #

Creates a new definition from a type signature

createBinding :: ValueBind dom -> Ann d dom SrcTemplateStage Source #

Creates a new definition from a value or function definition

isTypeSig :: Ann d dom SrcTemplateStage -> Bool Source #

Checks if a given definition is a type signature

isBinding :: Ann d dom SrcTemplateStage -> Bool Source #

Checks if a given definition is a function or value binding

Instances

BindingElem UDecl Source # 
BindingElem ULocalBind Source # 

Methods

sigBind :: (Functor w, Applicative w, Monad w, Functor r, Applicative r, MonadPlus r, Morph Maybe r) => Reference w r (MU *) (MU *) (Ann ULocalBind dom SrcTemplateStage) (Ann ULocalBind dom SrcTemplateStage) (TypeSignature dom) (TypeSignature dom) Source #

valBind :: (Functor w, Applicative w, Monad w, Functor r, Applicative r, MonadPlus r, Morph Maybe r) => Reference w r (MU *) (MU *) (Ann ULocalBind dom SrcTemplateStage) (Ann ULocalBind dom SrcTemplateStage) (ValueBind dom) (ValueBind dom) Source #

createTypeSig :: TypeSignature dom -> Ann ULocalBind dom SrcTemplateStage Source #

createBinding :: ValueBind dom -> Ann ULocalBind dom SrcTemplateStage Source #

isTypeSig :: Ann ULocalBind dom SrcTemplateStage -> Bool Source #

isBinding :: Ann ULocalBind dom SrcTemplateStage -> Bool Source #