Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Deterministic algorithm
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Determinism categories in languages == === Mercury === The [[Mercury (programming language)|mercury]] logic-functional programming language establishes different determinism categories for predicate modes as explained in the reference.<ref>{{Cite web |url=http://www.mercury.csse.unimelb.edu.au/information/doc-release/mercury_ref/Determinism-categories.html |title=Determinism categories in the Mercury programming language |access-date=2013-02-23 |archive-url=https://web.archive.org/web/20120703001434/http://www.mercury.csse.unimelb.edu.au/information/doc-release/mercury_ref/Determinism-categories.html#Determinism-categories |archive-date=2012-07-03 |url-status=dead }}</ref><ref>{{Cite web |url=http://www.mercury.csse.unimelb.edu.au/information/doc-release/mercury_ref/Predicate-and-function-mode-declarations.html |title=Mercury predicate modes |access-date=2013-02-25 |archive-url=https://web.archive.org/web/20120703001411/http://www.mercury.csse.unimelb.edu.au/information/doc-release/mercury_ref/Predicate-and-function-mode-declarations.html#Predicate-and-function-mode-declarations |archive-date=2012-07-03 |url-status=dead }}</ref> === Haskell === [[Haskell]] provides several mechanisms: * Non-determinism or notion of Fail ** the ''Maybe'' and ''Either'' types include the notion of success in the result. ** the ''fail'' method of the class Monad, may be used to signal ''fail'' as exception. ** the Maybe [[Monad (functional programming)|monad]] and MaybeT monad transformer provide for failed computations (stop the computation sequence and return Nothing)<ref>{{cite web|url=http://www.haskell.org/haskellwiki/Monad#Common_monads |title=Representing failure using the Maybe monad}}</ref> * Neterminism/non-det with multiple solutions ** you may retrieve all possible outcomes of a multiple result computation, by wrapping its result type in a MonadPlus [[Monad (functional programming)|monad]]. (its method ''mzero'' makes an outcome fail and ''mplus'' collects the successful results).<ref name="monad-plus">{{cite web|url=http://www.haskell.org/haskellwiki/MonadPlus |title=The class MonadPlus}}</ref> === ML family and derived languages === As seen in [[Standard ML]], [[OCaml]] and [[Scala (programming language)|Scala]] * The ''option'' type includes the notion of success. === Java === In [[Java (programming language)|Java]], the ''null'' reference value may represent an unsuccessful (out-of-domain) result.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)