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
Glasgow Haskell Compiler
(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!
===Extensions to Haskell=== Many extensions to Haskell have been proposed. These provide features not described in the language specification, or they redefine existing constructs. As such, each extension may not be supported by all Haskell implementations. There is an ongoing effort<ref>{{cite web |title = Welcome to Haskell' (Haskell Prime) |url = https://prime.haskell.org |website = Haskell.org |access-date = 26 May 2016 |archive-date = 20 February 2016 |archive-url = https://web.archive.org/web/20160220103915/https://prime.haskell.org/ |url-status = dead }}</ref> to describe extensions and select those which will be included in future versions of the language specification. The extensions<ref>{{cite web | title = GHC Language Features | url = https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/lang.html | website = Haskell.org | access-date = 25 May 2016 | archive-date = 29 June 2016 | archive-url = https://web.archive.org/web/20160629143456/https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/lang.html | url-status = dead }}</ref> supported by the Glasgow Haskell Compiler include: * Unboxed types and operations. These represent the primitive datatypes of the underlying hardware, without the indirection of a pointer to the [[dynamic allocation|heap]] or the possibility of deferred evaluation. Numerically intensive code can be significantly faster when coded using these types. * The ability to specify [[strict evaluation]] for a value, pattern binding, or datatype field. * More convenient syntax for working with modules, patterns, [[list comprehension]]s, operators, records, and tuples. * [[Syntactic sugar]] for computing with [[arrow (functional programming)|arrows]] and recursively-defined [[Monad (functional programming)|monadic]] values. Both of these concepts extend the monadic {{mono|do}}-notation provided in standard Haskell. * A significantly more powerful system of types and typeclasses, described below. * [[Template Haskell]], a system for compile-time [[metaprogramming]]. Expressions can be written to produce Haskell code in the form of an [[abstract syntax tree]]. These expressions are typechecked and evaluated at compile time; the generated code is then included as if it were part of the original code. Together with the ability to [[Reflective programming|reflect]] on definitions, this provides a powerful tool for further extensions to the language. * Quasi-quotation, which allows the user to define new concrete syntax for expressions and patterns. Quasi-quotation is useful when a metaprogram written in Haskell manipulates code written in a language other than Haskell. * [[Generic programming|Generic]] typeclasses, which specify functions solely in terms of the algebraic structure of the types they operate on. * Parallel evaluation of expressions using multiple CPU cores. This does ''not'' require explicitly spawning threads. The distribution of work happens implicitly, based on annotations provided in the program. * Compiler [[Directive (programming)|pragmas]] for directing optimizations such as [[inline expansion]] and specializing functions for particular types. * Customizable rewrite rules are rules describing how to replace one expression with an equivalent, but more efficiently evaluated expression. These are used within core [[data structure]] libraries to improve performance throughout application-level code.<ref> {{cite conference | last1 = Coutts | first1 = D. | last2 = Leshchinskiy | first2 = R. | last3 = Stewart | first3 = D. | date = April 2007 | title = Stream Fusion: From Lists to Streams to Nothing at All | book-title = Procedures of the ACM SIGPLAN International Conference on Functional Programming (ICFP) | url-status = dead | url = http://www.cse.unsw.edu.au/~dons/papers/CLS07.html | archive-url = https://web.archive.org/web/20070923094030/http://www.cse.unsw.edu.au/~dons/papers/CLS07.html | archive-date = 23 September 2007 }} </ref> * Record dot syntax. Provides [[syntactic sugar]] for accessing the fields of a (potentially nested) record which is similar to the syntax of many other programming languages.<ref> {{cite web | last1 = Mitchell | first1 = Neil | last2 = Fletcher | first2 = Shayne | date = 3 May 2020 | title = Record Dot Syntax | url = https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0282-record-dot-syntax.rst | work = ghc-proposals | publisher = [[GitHub]] | access-date = 30 June 2020 }} </ref>
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)