Language.Haskell.Refact.API

from Monad

type ParseResult

data VerboseLevel

data RefactSettings

type TargetModule

data RefactFlags

data StateStorage

The GHC Monad

type RefactGhc a

runRefactGhc

getRefacSettings

defaultSettings

logSettings

initGhcSession

loadModuleGraphGhc

ensureTargetLoaded

canonicalizeGraph

logm

from Utils

Managing the GHC / project environment

getModuleGhc

parseSourceFileGhc

activateModule

getModuleDetails

The bits that do the work

runRefacSession

applyRefac

refactDone

type ApplyRefacResult

data RefacSource

update

fileNameToModName

fileNameFromModSummary

getModuleName

clientModsAndFiles

serverModsAndFiles

from MonadFunctions

Conveniences for state access

fetchLinesFinal

fetchOrigToks

fetchToks

getTypecheckedModule

getRefactStreamModified

getRefactInscopes

getRefactRenamed

putRefactRenamed

getRefactParsed

putParsedModule

clearParsedModule

getRefactFileName

TokenUtils API

replaceToken

putToksForSpan

putDeclToksForSpan

getToksForSpan

getToksBeforeSpan

putToksForPos

addToksAfterSpan

addToksAfterPos

putDeclToksAfterSpan

removeToksForSpan

removeToksForPos

syncDeclToLatestStash

indentDeclAndToks

LayoutUtils API

For debugging

drawTokenTree

drawTokenTreeDetailed

getTokenTree

showLinesDebug

State flags for managing generic traversals

getRefactDone

setRefactDone

clearRefactDone

setStateStorage

getStateStorage

updateToks

updateToksWithPos

from LocUtils

type SimpPos

unmodified

modified

simpPos0

nullSrcSpan

whiteSpaceTokens

realSrcLocFromTok

isWhite

notWhite

isWhiteSpace

isWhiteSpaceOrIgnored

isIgnored

isIgnoredNonComment

isComment

isMultiLineComment

isOpenSquareBracket

isCloseSquareBracket

isIn

isComma

isBar

endsWithNewLn

startsWithNewLn

hasNewLn

compressPreNewLns

compressEndNewLns

lengthOfLastLine

getToks

replaceTokNoReAlign

deleteToks

doRmWhites

srcLocs

getSrcSpan

getAllSrcLocs

getBiggestStartEndLoc

extendForwards

extendBackwards

startEndLocIncFowComment

startEndLocIncComments

startEndLocIncComments'

tokenise

basicTokenise

prettyprintPatList

groupTokensByLine

toksOnSameLine

addLocInfo

getLineOffset

tokenCol

tokenColEnd

tokenRow

tokenPos

tokenPosEnd

tokenSrcSpan

tokenCon

increaseSrcSpan

getGhcLoc

getGhcLocEnd

getLocatedStart

getLocatedEnd

getStartEndLoc

startEndLocGhc

realSrcLocEndTok

fileNameFromTok

splitToks

emptyList

nonEmptyList

notWhiteSpace

isDoubleColon

isEmpty

isWhereOrLet

isWhere

isLet

isElse

isThen

isOf

isDo

getIndentOffset

splitOnNewLn

tokenLen

newLnToken

reSequenceToks

mkToken

mkZeroToken

markToken

isMarked

addOffsetToToks

matchTokenPos

rmOffsetFromToks

from TypeSyn

type InScopes

type PosToken

ghead

glast

gtail

gfromJust

from TypeUtils

Program Analysis

Imports and exports

inScopeInfo

isInScopeAndUnqualified

isInScopeAndUnqualifiedGhc

inScopeNames

isExported

isExplicitlyExported

modIsExported

Variable analysis

isFieldName

isClassName

isInstanceName

hsPNs

hsBinds

replaceBinds

class HsValBinds t

isDeclaredIn

hsFreeAndDeclaredPNsOld

hsFreeAndDeclaredNameStrings

hsFreeAndDeclaredPNs

hsFreeAndDeclaredGhc

getDeclaredTypes

getFvs

getFreeVars

getDeclaredVars

hsVisiblePNs

hsVisibleNames

hsFDsFromInside

hsFDNamesFromInside

hsVisibleDs

Property checking

isVarId

isConId

isOperator

isTopLevelPN

isLocalPN

isNonLibraryName

isQualifiedPN

isFunOrPatName

isTypeSig

isFunBindP

isFunBindR

isPatBindP

isPatBindR

isSimplePatBind

isComplexPatBind

isFunOrPatBindP

isFunOrPatBindR

usedWithoutQualR

isUsedInRhs

findPNT

findPN

findAllNameOccurences

findPNs

findEntity

findEntity'

sameOccurrence

findIdForName

getTypeForName

defines

definesP

definesTypeSig

sameBind

class UsedByRhs t

Modules and files

isMainModule

getModule

Locations

defineLoc

useLoc

locToExp

locToName

locToRdrName

getName

Program transformation

Adding

addDecl

addItemsToImport

addHiding

addParamsToDecls

addActualParamsToRhs

addImportDecl

duplicateDecl

Removing

rmDecl

rmTypeSig

rmTypeSigs

Updating

rmQualifier

qualifyToplevelName

renamePN

autoRenameLocalVar

Miscellous

Parsing, writing and showing

showEntities

showPNwithLoc

Locations

Default values

defaultPN

defaultName

defaultExp

Identifiers, expressions, patterns and declarations

ghcToPN

lghcToPN

expToName

nameToString

patToPNT

pNtoPat

definedPNs

definingDeclsNames

definingDeclsNames'

definingSigsNames

definingTyClDeclsNames

allNames

Others

mkRdrName

mkNewGhcName

mkNewName

mkNewToplevelName

causeNameClashInExports

removeOffset

Typed AST traversals (added by CMB)

Miscellous

Debug stuff

getDeclAndToks

getSigAndToks

getToksForDecl

removeToksOffset

getParsedForRenamedLPat

getParsedForRenamedName

getParsedForRenamedLocated

stripLeadingSpaces

from GhcUtils

SYB versions

everythingButStaged

somethingStaged

everythingStaged

somewhereMStaged

somewhereMStagedBu

everywhereMStaged

everywhereMStaged'

everywhereStaged

everywhereStaged'

onelayerStaged

listifyStaged

SYB Utility

checkItemRenamer

Strafunski StrategyLib versions

full_tdTUGhc

stop_tdTUGhc

stop_tdTPGhc

allTUGhc'

once_tdTPGhc

once_buTPGhc

oneTPGhc

allTUGhc

Strafunski utility

checkItemStage'

checkItemRenamer'

Scrap Your Zipper versions

zeverywhereStaged

zopenStaged

zsomewhereStaged

transZ

transZM

zopenStaged'

ztransformStagedM

SYZ utilities

checkZipperStaged

upUntil

findAbove

from GhcVersionSpecific

showGhc

prettyprint

prettyprint2

ppType

lexStringToTokens

getDataConstructors

setGhcContext

from TokenUtils

data Positioning

reIndentToks

ghcSrcSpanToForestSpan

Span conversion functions

gs2f

f2gs

gs2ss

ss2gs