Safe Haskell | None |
---|---|
Language | Haskell2010 |
Rasa.Internal.Extensions
Documentation
A wrapper around an extension of any type so it can be stored in an ExtMap
class HasExts s where Source #
Members of this class have access to editor extensions.
Minimal complete definition
class (Typeable m, Monad m) => HasExtMonad m where Source #
Methods
getExt :: (Typeable ext, Show ext, Default ext) => m ext Source #
Retrieve some extension state
setExt :: (Typeable ext, Show ext, Default ext) => ext -> m () Source #
Set some extension state
overExt :: (Typeable ext, Show ext, Default ext) => (ext -> ext) -> m () Source #
Set some extension state
Instances
ext :: forall a e. (Show a, Typeable a, Default a, HasExts e) => Lens' e a Source #
This is a lens which will focus the extension state that matches the type inferred as the focal point. It's a little bit of magic, if you treat the focus as a member of your extension state it should just work out.
This lens falls back on the extension's Default
instance (when getting) if
nothing has yet been stored.