Copyright | (c) Sebastian Witte |
---|---|
License | Apache-2.0 |
Maintainer | woozletoff@gmail.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Neovim.Classes
Description
Synopsis
- class NFData o => NvimObject o where
- toObject :: o -> Object
- fromObjectUnsafe :: Object -> o
- fromObject :: Object -> Either (Doc AnsiStyle) o
- fromObject' :: MonadIO io => Object -> io o
- type Dictionary = Map ByteString Object
- (+:) :: NvimObject o => o -> [Object] -> [Object]
- class Generic a
- docToObject :: Doc AnsiStyle -> Object
- docFromObject :: Object -> Either (Doc AnsiStyle) (Doc AnsiStyle)
- docToText :: Doc AnsiStyle -> Text
- data Doc ann
- data AnsiStyle
- class Pretty a where
- pretty :: a -> Doc ann
- prettyList :: [a] -> Doc ann
- (<+>) :: Doc ann -> Doc ann -> Doc ann
- data Int8
- data Int16
- data Int32
- data Int64
- data Word
- data Word8
- data Word16
- data Word32
- data Word64
- module Control.DeepSeq
Documentation
class NFData o => NvimObject o where Source #
Conversion from Object
files to Haskell types and back with respect
to neovim's interpretation.
The NFData
constraint has been added to allow forcing results of function
evaluations in order to catch exceptions from pure code. This adds more
stability to the plugin provider and seems to be a cleaner approach.
Minimal complete definition
Methods
toObject :: o -> Object Source #
fromObjectUnsafe :: Object -> o Source #
fromObject :: Object -> Either (Doc AnsiStyle) o Source #
fromObject' :: MonadIO io => Object -> io o Source #
Instances
type Dictionary = Map ByteString Object Source #
A generic vim dictionary is a simply a map from strings to objects. This type alias is sometimes useful as a type annotation especially if the OverloadedStrings extension is enabled.
(+:) :: NvimObject o => o -> [Object] -> [Object] infixr 5 Source #
Convenient operator to create a list of Object
from normal values.
values +: of :+ different :+ types :+ can +: be +: combined +: this +: way +: []
Representable types of kind *
.
This class is derivable in GHC with the DeriveGeneric
flag on.
A Generic
instance must satisfy the following laws:
from
.to
≡id
to
.from
≡id
Instances
docFromObject :: Object -> Either (Doc AnsiStyle) (Doc AnsiStyle) Source #
See docToObject
.
The abstract data type
represents pretty documents that have
been annotated with data of type Doc
annann
.
More specifically, a value of type
represents a non-empty set of
possible layouts of a document. The layout functions select one of these
possibilities, taking into account things like the width of the output
document.Doc
The annotation is an arbitrary piece of data associated with (part of) a document. Annotations may be used by the rendering backends in order to display output differently, such as
- color information (e.g. when rendering to the terminal)
- mouseover text (e.g. when rendering to rich HTML)
- whether to show something or not (to allow simple or detailed versions)
The simplest way to display a Doc
is via the Show
class.
>>>
putStrLn (show (vsep ["hello", "world"]))
hello world
Instances
Render the annotated document in a certain style. Styles not set in the annotation will use the style of the surrounding document, or the terminal’s default if none has been set yet.
style =color
Green
<>
bold
styledDoc =annotate
style "hello world"
Instances
Monoid AnsiStyle |
|
Semigroup AnsiStyle | Keep the first decision for each of foreground color, background color, boldness, italication, and underlining. If a certain style is not set, the terminal’s default will be used. Example:
is red because the first color wins, and not bold because (or if) that’s the terminal’s default. |
Show AnsiStyle | |
Eq AnsiStyle | |
Ord AnsiStyle | |
Defined in Prettyprinter.Render.Terminal.Internal |
Minimal complete definition
Methods
>>>
pretty 1 <+> pretty "hello" <+> pretty 1.234
1 hello 1.234
prettyList :: [a] -> Doc ann #
is only used to define the prettyList
instance
. In normal circumstances only the Pretty
a => Pretty
[a]
function is used.pretty
>>>
prettyList [1, 23, 456]
[1, 23, 456]
Instances
Pretty Void | Finding a good example for printing something that does not exist is hard, so here is an example of printing a list full of nothing.
|
Defined in Prettyprinter.Internal | |
Pretty Int16 | |
Defined in Prettyprinter.Internal | |
Pretty Int32 | |
Defined in Prettyprinter.Internal | |
Pretty Int64 | |
Defined in Prettyprinter.Internal | |
Pretty Int8 | |
Defined in Prettyprinter.Internal | |
Pretty Word16 | |
Defined in Prettyprinter.Internal | |
Pretty Word32 | |
Defined in Prettyprinter.Internal | |
Pretty Word64 | |
Defined in Prettyprinter.Internal | |
Pretty Word8 | |
Defined in Prettyprinter.Internal | |
Pretty FunctionType Source # | |
Defined in Neovim.Context.Internal | |
Pretty AutocmdOptions Source # | |
Defined in Neovim.Plugin.Classes | |
Pretty CommandArguments Source # | |
Defined in Neovim.Plugin.Classes | |
Pretty CommandOption Source # | |
Defined in Neovim.Plugin.Classes | |
Pretty CommandOptions Source # | |
Defined in Neovim.Plugin.Classes | |
Pretty FunctionName Source # | |
Defined in Neovim.Plugin.Classes | |
Pretty FunctionalityDescription Source # | |
Defined in Neovim.Plugin.Classes Methods pretty :: FunctionalityDescription -> Doc ann # prettyList :: [FunctionalityDescription] -> Doc ann # | |
Pretty NeovimEventId Source # | |
Defined in Neovim.Plugin.Classes | |
Pretty NvimMethod Source # | |
Defined in Neovim.Plugin.Classes | |
Pretty RangeSpecification Source # | |
Defined in Neovim.Plugin.Classes | |
Pretty Synchronous Source # | |
Defined in Neovim.Plugin.Classes | |
Pretty FunctionCall Source # | |
Defined in Neovim.Plugin.IPC.Classes | |
Pretty Notification Source # | |
Defined in Neovim.Plugin.IPC.Classes | |
Pretty Request Source # | |
Defined in Neovim.Plugin.IPC.Classes | |
Pretty Message Source # | |
Defined in Neovim.RPC.Classes | |
Pretty Text | Automatically converts all newlines to
Note that
Manually use |
Defined in Prettyprinter.Internal | |
Pretty Text | (lazy |
Defined in Prettyprinter.Internal | |
Pretty Integer |
|
Defined in Prettyprinter.Internal | |
Pretty Natural | |
Defined in Prettyprinter.Internal | |
Pretty () |
The argument is not used:
|
Defined in Prettyprinter.Internal | |
Pretty Bool |
|
Defined in Prettyprinter.Internal | |
Pretty Char | Instead of
|
Defined in Prettyprinter.Internal | |
Pretty Double |
|
Defined in Prettyprinter.Internal | |
Pretty Float |
|
Defined in Prettyprinter.Internal | |
Pretty Int |
|
Defined in Prettyprinter.Internal | |
Pretty Word | |
Defined in Prettyprinter.Internal | |
Pretty a => Pretty (Identity a) |
|
Defined in Prettyprinter.Internal | |
Pretty a => Pretty (NonEmpty a) | |
Defined in Prettyprinter.Internal | |
Pretty a => Pretty (Maybe a) | Ignore
|
Defined in Prettyprinter.Internal | |
Pretty a => Pretty [a] |
|
Defined in Prettyprinter.Internal | |
(Pretty a1, Pretty a2) => Pretty (a1, a2) |
|
Defined in Prettyprinter.Internal | |
Pretty a => Pretty (Const a b) | |
Defined in Prettyprinter.Internal | |
(Pretty a1, Pretty a2, Pretty a3) => Pretty (a1, a2, a3) |
|
Defined in Prettyprinter.Internal |
8-bit signed integer type
Instances
16-bit signed integer type
Instances
32-bit signed integer type
Instances
64-bit signed integer type
Instances
Instances
Data Word | Since: base-4.0.0.0 |
Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word -> c Word # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word # dataTypeOf :: Word -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word) # gmapT :: (forall b. Data b => b -> b) -> Word -> Word # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r # gmapQ :: (forall d. Data d => d -> u) -> Word -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word -> m Word # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word # | |
Storable Word | Since: base-2.1 |
Defined in Foreign.Storable | |
Bounded Word | Since: base-2.1 |
Enum Word | Since: base-2.1 |
Ix Word | Since: base-4.6.0.0 |
Num Word | Since: base-2.1 |
Read Word | Since: base-4.5.0.0 |
Integral Word | Since: base-2.1 |
Real Word | Since: base-2.1 |
Defined in GHC.Real Methods toRational :: Word -> Rational # | |
Show Word | Since: base-2.1 |
Serialize Word | |
Default Word | |
Defined in Data.Default.Class | |
NFData Word | |
Defined in Control.DeepSeq | |
Eq Word | |
Ord Word | |
Hashable Word | |
Defined in Data.Hashable.Class | |
NvimObject Word Source # | |
Pretty Word | |
Defined in Prettyprinter.Internal | |
Prim Word | |
Defined in Data.Primitive.Types Methods alignment# :: Word -> Int# # indexByteArray# :: ByteArray# -> Int# -> Word # readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Word #) # writeByteArray# :: MutableByteArray# s -> Int# -> Word -> State# s -> State# s # setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Word -> State# s -> State# s # indexOffAddr# :: Addr# -> Int# -> Word # readOffAddr# :: Addr# -> Int# -> State# s -> (# State# s, Word #) # writeOffAddr# :: Addr# -> Int# -> Word -> State# s -> State# s # setOffAddr# :: Addr# -> Int# -> Int# -> Word -> State# s -> State# s # | |
Uniform Word | |
Defined in System.Random.Internal Methods uniformM :: StatefulGen g m => g -> m Word # | |
UniformRange Word | |
Defined in System.Random.Internal | |
Unbox Word | |
Defined in Data.Vector.Unboxed.Base | |
Lift Word | |
Vector Vector Word | |
Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Word -> ST s (Vector Word) # basicUnsafeThaw :: Vector Word -> ST s (Mutable Vector s Word) # basicLength :: Vector Word -> Int # basicUnsafeSlice :: Int -> Int -> Vector Word -> Vector Word # basicUnsafeIndexM :: Vector Word -> Int -> Box Word # basicUnsafeCopy :: Mutable Vector s Word -> Vector Word -> ST s () # | |
MVector MVector Word | |
Defined in Data.Vector.Unboxed.Base Methods basicLength :: MVector s Word -> Int # basicUnsafeSlice :: Int -> Int -> MVector s Word -> MVector s Word # basicOverlaps :: MVector s Word -> MVector s Word -> Bool # basicUnsafeNew :: Int -> ST s (MVector s Word) # basicInitialize :: MVector s Word -> ST s () # basicUnsafeReplicate :: Int -> Word -> ST s (MVector s Word) # basicUnsafeRead :: MVector s Word -> Int -> ST s Word # basicUnsafeWrite :: MVector s Word -> Int -> Word -> ST s () # basicClear :: MVector s Word -> ST s () # basicSet :: MVector s Word -> Word -> ST s () # basicUnsafeCopy :: MVector s Word -> MVector s Word -> ST s () # basicUnsafeMove :: MVector s Word -> MVector s Word -> ST s () # basicUnsafeGrow :: MVector s Word -> Int -> ST s (MVector s Word) # | |
Generic1 (URec Word :: k -> Type) | |
Foldable (UWord :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable Methods fold :: Monoid m => UWord m -> m # foldMap :: Monoid m => (a -> m) -> UWord a -> m # foldMap' :: Monoid m => (a -> m) -> UWord a -> m # foldr :: (a -> b -> b) -> b -> UWord a -> b # foldr' :: (a -> b -> b) -> b -> UWord a -> b # foldl :: (b -> a -> b) -> b -> UWord a -> b # foldl' :: (b -> a -> b) -> b -> UWord a -> b # foldr1 :: (a -> a -> a) -> UWord a -> a # foldl1 :: (a -> a -> a) -> UWord a -> a # elem :: Eq a => a -> UWord a -> Bool # maximum :: Ord a => UWord a -> a # minimum :: Ord a => UWord a -> a # | |
Traversable (UWord :: Type -> Type) | Since: base-4.9.0.0 |
Functor (URec Word :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Generic (URec Word p) | |
Show (URec Word p) | Since: base-4.9.0.0 |
Eq (URec Word p) | Since: base-4.9.0.0 |
Ord (URec Word p) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
newtype Vector Word | |
data URec Word (p :: k) | Used for marking occurrences of Since: base-4.9.0.0 |
newtype MVector s Word | |
type Rep1 (URec Word :: k -> Type) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep (URec Word p) | Since: base-4.9.0.0 |
Defined in GHC.Generics |
8-bit unsigned integer type
Instances
16-bit unsigned integer type
Instances
32-bit unsigned integer type
Instances
64-bit unsigned integer type
Instances
module Control.DeepSeq