Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
A wrapper around an extension of any type so it can be stored in an ExtMap
class HasBufExts s where Source #
Members of this class have access to buffer extensions. (Each Buffer
is a member of this class)
bufExt :: forall a s. (Show a, Typeable a, Default a, HasBufExts s) => Lens' s a Source #
bufExt
is a lens which will focus a given extension's state within a
buffer (within a BufAction
). The lens will automagically focus
the required extension by using type inference. 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.
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.