nvim-hs-0.2.5: Haskell plugin backend for neovim

Copyright(c) Sebastian Witte
LicenseApache-2.0
Maintainerwoozletoff@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Neovim.API.TH

Description

 

Synopsis

Documentation

generateAPI :: Map String (Q Type) -> Q [Dec] Source #

Generate the API types and functions provided by nvim --api-info.

The provided map allows the use of different Haskell types for the types defined in the API. The types must be an instance of NvimObject and they must form an isomorphism with the sent messages types. Currently, it provides a Convenient way to replace the String type with Text, ByteString or String.

function :: String -> Name -> Q Exp Source #

Define an exported function by providing a custom name and referencing the function you want to export.

Note that the name must start with an upper case letter.

Example: $(function "MyExportedFunction" 'myDefinedFunction) Sync

function' :: Name -> Q Exp Source #

Define an exported function. This function works exactly like function, but it generates the exported name automatically by converting the first letter to upper case.

command :: String -> Name -> Q Exp Source #

Similarly to function, this function is used to export a command with a custom name.

Note that commands must start with an upper case letter.

Due to limitations on the side of (neo)vim, commands can only have one of the following five signatures, where you can replace String with ByteString or Text if you wish:

Example: $(command "RememberThePrime" 'someFunction) [CmdBang]

Note that the list of command options (i.e. the last argument) removes duplicate options by means of some internally convenient sorting. You should simply not define the same option twice.

command' :: Name -> Q Exp Source #

Define an exported command. This function works exactly like command, but it generates the command name by converting the first letter to upper case.

defaultAPITypeToHaskellTypeMap :: Map String (Q Type) Source #

Default type mappings for the requested API.

module Data.Data