Skip to content

Documentation garbles backslashes, leading to incomprehensible examples #607

@navid-zamani

Description

@navid-zamani

Consider, for example: https://hackage.haskell.org/package/lsp-2.7.0.1/docs/Language-LSP-Server.html#v:interpretHandler

The code snippet reads:

 ServerDefinition { ...
 , doInitialize = env _req -> pure $ Right env
 , interpretHandler = env -> Iso
    (runLspT env) -- how to convert from IO ~> m
    liftIO        -- how to convert from m ~> IO
 }

Making people wonder what strange new language extension syntax that may be. (Arrows perhaps?)

But looking at the source, it turns out, it is just lambdas:

  -- @
  --  ServerDefinition { ...
  --  , doInitialize = \env _req -> pure $ Right env
  --  , interpretHandler = \env -> Iso
  --     (runLspT env) -- how to convert from IO ~> m
  --     liftIO        -- how to convert from m ~> IO
  --  }
  -- @

It seems the backslashes got eaten due to an escaping mechanism in the documentation generator.

This is a problem throughout all of the documentation.

So I kindly ask if you could fix that, so it becomes understandable? :)


(BTW: I very much miss an actual guide on how to use this. A reference documentation is of course nice, but an actual guide/howto/intro, even if short, would make it possible to understand how it is meant to be used in its entirety. Not even the library and functions to start with is clear as it is, and must be dug up. Unfortunately this is a common problem with Haskell package documentation. Maybe while we’re at it, a quick thing could be added. haskell-language-server is really way too large to serve as an example for a beginner. :-/)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions