hls-tactics-plugin-1.1.0.0: Wingman plugin for Haskell Language Server
Safe HaskellNone
LanguageHaskell2010

Wingman.Context

Synopsis

Documentation

getKnownThing :: MonadReader Context m => (KnownThings -> a) -> m a Source #

Extract something from KnownThings.

getKnownInstance :: MonadReader Context m => (KnownThings -> Class) -> [Type] -> m (Maybe (Class, PredType)) Source #

Like getInstance, but uses a class from the KnownThings.

getInstance :: MonadReader Context m => Class -> [Type] -> m (Maybe (Class, PredType)) Source #

Determine if there is an instance that exists for the given Class at the specified types. Deeply checks contexts to ensure the instance is actually real.

If so, this returns a PredType that corresponds to the type of the dictionary.

hasClassInstance :: MonadReader Context m => PredType -> m Bool Source #

Like getInstance, but only returns whether or not it succeeded. Can fail fast, and uses a cached Theta from the context.