Skip to content
Brandon Barker edited this page Aug 8, 2014 · 11 revisions

This page lists built-in operators for ATS.

  • != - "Not equal to" (float/double/int). Also the same as <>, but preferred since it is easier to read for most and does not share the same string as the function effect <>.
  • <> - "Not equal to" (float/double/int). Also the same as !=, but not recommended in general since it is less common than != in most programming languages and does not share the same string as the function effect <>.
  • => - Similar to =, but used to define the body of a lambda function or a case expression.
  • =>> - Similar to =>, but indicates to the typechecker that this clause needs to be typechecked under the sequentiality assumption that the given value that matches it does not match the pattern guards associated with any previous clauses. For more information, see Sequentiality of Pattern Matching or the forums.
  • =/=> - Similar to =>> but indicates to the typechecker that the proof following =/=> must prove falsehood. During compilation (after typechecking), the third clause is removed as it can never be chosen at run-time because matching v against yields falsehood.
  • =/=>> combines the features of =/=> and =>>.
  • # - Allows static variables present in a function return type to be used in the statics of the function's arguments. For example, if we want b from the return type to be in the scope of the statics in the arguments, (that is, b in opt (a,b)):
fun{a:t@ype}
linset_choose (xs: !set a, x0: &a? >> opt (a, b)) : #[b:bool] bool (b)
Clone this wiki locally