-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stdlib variants: better names, structure, and an alerting thread/even…
…t replacement (#22) * move files around * draw out each alert module type for easy reuse
- Loading branch information
Showing
12 changed files
with
313 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
(library | ||
(name stdlib_variants) | ||
(public_name less-power.stdlib-variants) | ||
|
||
(libraries common stdlib_components stdlib_alerts)) | ||
(documentation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(library | ||
(name std_overrides) | ||
(public_name less-power.std-overrides) | ||
(libraries stdlib_alerts stdlib_components)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
(** Ready-to-use modules for replacing the default pervasives, using [-open]. *) | ||
|
||
module Hide_stdlib_variants = struct | ||
(** Prevent access to the full variant library. Intended to be opened at the top level | ||
to hide the [Stdlib_variants] module, and a couple others. | ||
This is included in the other overrides modules, so you usually don't need | ||
to pass it to the [-open] flag yourself. However, you should use it | ||
if you define your own override module based on less-power stdlib variants. *) | ||
|
||
(** {i These modules are intentionally empty.} *) | ||
|
||
module Stdlib_variants = struct end | ||
|
||
(* Shouldn't be necessary with (implicit_transitive_deps false), but to be safe... *) | ||
module Stdlib_components = struct end | ||
module Stdlib_alerts = struct end | ||
module Threads_alerts = struct end | ||
|
||
end | ||
|
||
|
||
(** Puts the safe parts of [Stdlib] into scope, | ||
from {!Stdlib_components.Stdlib_safe} *) | ||
module Stdlib_safe = struct | ||
|
||
module Stdlib = Stdlib_components.Stdlib_safe | ||
include Stdlib_components.Stdlib_safe | ||
|
||
include Hide_stdlib_variants | ||
end | ||
|
||
(** Puts an alerting [Stdlib] into scope, | ||
from {!Stdlib_alerts.Stdlib_alerting}. *) | ||
module Stdlib_alerting = struct | ||
|
||
module Stdlib = Stdlib_alerts.Stdlib_alerting | ||
include Stdlib_alerts.Stdlib_alerting | ||
|
||
include Hide_stdlib_variants | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
(library | ||
(name stdlib_alerts) | ||
(public_name less-power.stdlib-alerts) | ||
(modules stdlib_alerts) | ||
(preprocess (pps signature_builder_ppx)) | ||
(libraries signature_builder)) | ||
|
||
(library | ||
(name threads_alerts) | ||
(public_name less-power.threads-alerts) | ||
(modules threads_alerts) | ||
(preprocess (pps signature_builder_ppx)) | ||
(libraries signature_builder threads unix)) |
Oops, something went wrong.