ollama-holes-plugin-0.1.5.0: A typed-hole plugin that uses LLMs to generate valid hole-fits
Safe HaskellSafe-Inferred
LanguageGHC2021

GHC.Plugin.OllamaHoles

Description

The Ollama plugin for GHC

Synopsis

Documentation

promptTemplate :: Text Source #

Prompt used to prompt the LLM

getBackend :: Flags -> Backend Source #

Determine which backend to use

plugin :: Plugin Source #

Ollama plugin for GHC

parseInContext :: Text -> TcM (Either String (LHsExpr GhcPs)) Source #

Parse an expression in the current context

verifyHoleFit :: Bool -> TypedHole -> Text -> TcM Bool Source #

Check that the hole fit matches the type of the hole

seekGuidance :: [HoleFitCandidate] -> TcM String Source #

Try to find the guide provided by the user

preProcess :: [Text] -> [Text] Source #

Preprocess the response to remove empty lines, lines with only spaces, and code blocks

data Flags Source #

Command line options for the plugin

defaultFlags :: Flags Source #

Default flags for the plugin

getDocs :: [HoleFitCandidate] -> TcM String Source #

Produce the documentation of all the HolefitCandidates.

fullyQualified :: HoleFitCandidate -> Maybe RdrName Source #

Produce a fully qualified name, e.g. L.sort if Data.List is imported as L

parseFlags :: [CommandLineOption] -> Flags Source #

Parse command line options

replacePlaceholders :: Text -> [(Text, String)] -> Text Source #

Helper function to replace placeholders in a template string