Language features

From Clean
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Clean is a general purpose, state-of-the-art, pure and lazy functional programming language designed for making real-world applications. Here is a list of the most notable language features:

  • Clean is a lazy, pure, and higher-order functional programming language with explicit graph-rewriting semantics.
  • Although Clean is by default a lazy language, one can smoothly turn it into a strict language to obtain optimal time/space behavior: functions can be defined lazy as well as (partially) strict in their arguments; any (recursive) data structure can be defined lazy as well as (partially) strict in any of its arguments.
  • Clean is a strongly typed language based on an extension of the well-known Milner/Hindley/Mycroft type inferencing/checking scheme including the common higher-order types, polymorphic types, abstract types, algebraic types, type synonyms, and existentially quantified types.
  • Clean has pattern matching, guards, list comprehensions, array comprehensions and a lay-out sensitive mode.
  • Clean supports type classes and type constructor classes to make overloaded use of functions and operators possible.
  • The uniqueness typing system of Clean makes it possible to develop efficient applications. In particular, it allows a refined control over the single-threaded use of objects which can influence the time and space behavior of programs. Uniqueness typing can also be used to incorporate destructive updates of objects within a pure functional framework. It allows destructive transformation of state information and enables efficient interfacing to the nonfunctional world (to C but also to I/O systems like X-Windows) offering direct access to file systems and operating systems.
  • Clean offers records and (destructively updateable) arrays and files.
  • The Clean type system supports dynamic types, allowing values of arbitrary types to be wrapped in a uniform package and unwrapped via a type annotation at run time. Using dynamics, code and data can be exchanged between Clean applications in a flexible and type-safe way.
  • Clean provides a built-in mechanism for generic functions.
  • There is a Clean IDE and there are many libraries available offering additional functionality.