Language.LSP.Protocol.Utils.Misc

lsp-types-2.3.0.1: Haskell library for the Microsoft Language Server Protocol, data types

Safe Haskell | None
Language | GHC2021

Language.LSP.Protocol.Utils.Misc

Synopsis

- rdrop :: Int -> [a] -> [a]
- makeSingletonFromJSON :: Name -> Name -> [Name] -> Q [Dec]
- makeRegHelper :: Name -> DecsQ
- lspOptions :: Options
- lspOptionsUntagged :: Options
- prettyJSON :: Value -> Doc ann
- newtype ViaJSON a = ViaJSON a
- genLenses :: [Name] -> Q [Dec]

# Documentation

rdrop :: Int -> [a] -> [a] #

makeSingletonFromJSON :: Name -> Name -> [Name] -> Q [Dec] #

Given a wrapper and a singleton GADT, construct FromJSON instances for each constructor return type by invoking the FromJSON instance for the wrapper and unwrapping

makeRegHelper :: Name -> DecsQ #

lspOptions :: Options #

Standard options for use when generating JSON instances NOTE: This needs to be in a separate file because of the TH stage restriction

lspOptionsUntagged :: Options #

Standard options for use when generating JSON instances for an untagged union

prettyJSON :: Value -> Doc ann #

newtype ViaJSON a #

Constructors

ViaJSON a |

#### Instances

Instances details

ToJSON a => Pretty (ViaJSON a) # |
Instance details Defined in Language.LSP.Protocol.Utils.Misc Methods pretty :: ViaJSON a -> Doc ann # prettyList :: [ViaJSON a] -> Doc ann #

genLenses :: [Name] -> Q [Dec] #

Given a list of type names, make a splice that generates the lens typeclass declarations for all of them. Defined here to avoid stage restrictions.