Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect docstrings of functions imported with include/open Foo #143

Open
Fourchaux opened this issue Jul 21, 2020 · 3 comments
Open

Incorrect docstrings of functions imported with include/open Foo #143

Fourchaux opened this issue Jul 21, 2020 · 3 comments

Comments

@Fourchaux
Copy link

Fourchaux commented Jul 21, 2020

Tests with: OCaml 4.10.0+flambda - Containers 2.8.1 (opam version) - b0 0.0.1 (opam version) - ocp-index 1.2 (opam version)

The comments of functions imported with include/open Foo are incorrect.
Examples:

  • In CCRandom.ml:
open CCShims_
include Random ...

$ ocp-index print CCRandom.init
CCRandom.init val int -> unit
    [flat_map f g st] is [f (g st) st].

Instead of:
$ ocp-index print Random.init
Stdlib__random.init val int -> unit
    Initialize the generator, using the argument as a seed.
    The same seed will always yield the same sequence of numbers.
  • In CCList.ml:
open CCShims_ ...

$ ocp-index print CCList.hd
CCList.hd val 'a list -> 'a
    Like [append].
    Concatenate two lists.

Instead of:
$ ocp-index print List.hd
Stdlib__list.hd val 'a list -> 'a
    Return the first element of the given list. Raise
    [Failure "hd"] if the list is empty.
  • In b00_std.ml:
module Char = struct
  include Char ...

$ ocp-index print B00_std.Char.compare
B00_std.Char.compare val t -> t -> int
    [cap tty] determines [tty]'s capabilities.
    {1:style ANSI escapes and styling}

Instead of:
$ ocp-index print Char.compare
Stdlib__char.compare val t -> t -> int
    The comparison function for characters, with the same specification as
    {!Stdlib.compare}.  Along with the type [t], this function [compare]
    allows the module [Char] to be passed as argument to the functors
    {!Set.Make} and {!Map.Make}.
@Fourchaux Fourchaux changed the title Incorrect docstrings for several Containers Modules (CCString, CCList, CCArray) Incorrect docstrings of functions imported with include/open Foo Jul 23, 2020
@AltGr
Copy link
Member

AltGr commented Sep 8, 2020

Thanks for reporting! I'll look into it.

@Fourchaux
Copy link
Author

Fourchaux commented Feb 25, 2021

(Update) tests with: OCaml 4.12.0+flambda - Containers 3.2 (opam version) - ocp-index 1.2.2 (opam version)

Docstrings are different but (still) incorrect:
e.g. with Containers:

$ ocp-index print CCList.hd
CCList.hd val 'a list -> 'a
    [fold_while f init l] folds until a stop condition via [('a, `Stop)] is
    indicated by the accumulator.
    @since 0.8

@Drup
Copy link
Collaborator

Drup commented May 18, 2022

This bug is very confusing.

Most of your examples are now correctly handled ... except for the first one. I have no idea why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants