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

random:maybe/0 is badly named #2755

Open
dcnorris opened this issue Jan 7, 2025 · 1 comment
Open

random:maybe/0 is badly named #2755

dcnorris opened this issue Jan 7, 2025 · 1 comment

Comments

@dcnorris
Copy link

dcnorris commented Jan 7, 2025

Currently defined as,

%% maybe.
% 
% Succeeds with probability 0.5.
maybe :- '$maybe'.

and works like this:

?- use_module(library(random)).
   true.
?- maybe.
   true.
?- maybe.
   true.
?- maybe.
   false.
?- maybe.
   true.

A more suitable name would be based on the https://en.wikipedia.org/wiki/Bernoulli_trial concept.

The clash with Maybe types as in Haskell — or Rust! — is also unfortunate.

@UWN
Copy link

UWN commented Jan 7, 2025

Another clash is with the answer description maybe to signal some constraints that are not shown. Originally in CLP(R)

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

2 participants