Skip to content

Commit

Permalink
docs: perfect the display of Bwd.bwd and other cross-refs
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Apr 30, 2022
1 parent dbb4698 commit 6551e12
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Bwd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ include BwdDef

module Bwd = BwdNoLabels
module BwdLabels = BwdLabels
module BwdNotation = Bwd.Notation
module BwdNotation = BwdNotation
7 changes: 6 additions & 1 deletion src/Bwd.mli
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ type 'a bwd = 'a BwdDef.bwd =
| Emp
| Snoc of 'a bwd * 'a

(** This module is similar to {!module:List} but for backward lists. *)
module Bwd : module type of BwdNoLabels

(** This module is similar to {!module:ListLabels} but for backward lists. *)
module BwdLabels : module type of BwdLabels
module BwdNotation : module type of BwdNoLabels.Notation

(** An alias of {!module:Bwd.Notation} for infix notation. *)
module BwdNotation : module type of BwdNotation
14 changes: 7 additions & 7 deletions src/BwdLabels.mli
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
(**
This module is similar to {!module:ListLabels} but for backward lists.
Notes on the discrepancies with {!module:ListLabels}:
{ul
{- Functions [rev], [rev_append], [rev_map], and [rev_map2] will {i never} be included.}
Expand All @@ -13,6 +11,7 @@
We want to make this library useful to you, too!
*)

(** @canonical Bwd.bwd *)
type 'a t = 'a BwdDef.bwd =
| Emp
| Snoc of 'a t * 'a
Expand Down Expand Up @@ -95,16 +94,17 @@ val combine : 'a t -> 'b t -> ('a * 'b) t
val to_list : 'a t -> 'a list
val of_list : 'a list -> 'a t

(** {1 Infix notation} *)

(** Notation inspired by Conor McBride. *)
module Notation :
sig
(** Notation inspired by Conor McBride. *)

val (#<) : 'a t -> 'a -> 'a t
(** Alias of {!val:Bwd.snoc}. *)
(** An alias of {!val:BwdLabels.snoc}. *)

val (<><) : 'a t -> 'a list -> 'a t
(** Alias of {!val:Bwd.append}. *)
(** An alias of {!val:BwdLabels.append}. *)

val (<>>) : 'a t -> 'a list -> 'a list
(** Alias of {!val:Bwd.prepend}. *)
(** An alias of {!val:BwdLabels.prepend}. *)
end
18 changes: 9 additions & 9 deletions src/BwdNoLabels.mli
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
(** @canonical Bwd.Bwd *)

(**
This module is similar to {!module:List} but for backward lists.
Notes on the discrepancies with {!module:List}:
{ul
{- Functions [rev], [rev_append], [rev_map], and [rev_map2] will {i never} be included.}
Expand All @@ -13,8 +9,11 @@
Please {{: https://github.com/RedPRL/ocaml-bwd/issues/new/choose}open a GitHub issue} if you want a function to be included.
We want to make this library useful to you, too!
@canonical Bwd.Bwd
*)

(** @canonical Bwd.bwd *)
type 'a t = 'a BwdDef.bwd =
| Emp
| Snoc of 'a t * 'a
Expand Down Expand Up @@ -97,16 +96,17 @@ val combine : 'a t -> 'b t -> ('a * 'b) t
val to_list : 'a t -> 'a list
val of_list : 'a list -> 'a t

(** {1 Infix notation} *)

(** Notation inspired by Conor McBride. *)
module Notation :
sig
(** Notation inspired by Conor McBride. *)

val (#<) : 'a t -> 'a -> 'a t
(** Alias of {!val:Bwd.snoc}. *)
(** An alias of {!val:Bwd.snoc}. *)

val (<><) : 'a t -> 'a list -> 'a t
(** Alias of {!val:Bwd.append}. *)
(** An alias of {!val:Bwd.append}. *)

val (<>>) : 'a t -> 'a list -> 'a list
(** Alias of {!val:Bwd.prepend}. *)
(** An alias of {!val:Bwd.prepend}. *)
end
1 change: 1 addition & 0 deletions src/BwdNotation.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include BwdNoLabels.Notation
2 changes: 2 additions & 0 deletions src/BwdNotation.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include module type of BwdNoLabels.Notation
(** @open *)

0 comments on commit 6551e12

Please sign in to comment.