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
List comprehension
(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!
==History== The existence of related constructs predates the use of the term "List Comprehension". The [[SETL]] programming language (1969) has a set formation construct which is similar to list comprehensions. E.g., this code prints all prime numbers from 2 to {{var|N}}: print([n in [2..N] | forall m in {2..n - 1} | n mod m > 0]); The [[computer algebra system]] [[Axiom (computer algebra system)|AXIOM]] (1973) has a similar construct that processes [[stream (computing)|stream]]s. The first use of the term "comprehension" for such constructs was in [[Rod Burstall]] and [[John Darlington]]'s description of their functional programming language [[NPL programming language|NPL]] from 1977. In his retrospective "Some History of Functional Programming Languages",<ref>{{cite conference | first = David | last = Turner | url = https://www.cs.kent.ac.uk/people/staff/dat/tfp12/tfp12.pdf | title = Some history of functional programming languages | book-title = International Symposium on Trends in Functional Programming, Springer, Berlin, Heidelberg | pages = 1–20 | year = 2012}}</ref> [[David_Turner_(computer_scientist)|David Turner]] recalls: {{quote|text=NPL was implemented in POP2 by Burstall and used for Darlington’s work on program transformation (Burstall & Darlington 1977). The language was first order, strongly (but not polymorphically) typed, purely functional, call-by-value. It also had “set expressions” e.g. :<pre>setofeven (X) <= <:x : x in X & even(x):>}}</pre> }} In a footnote attached to the term "list comprehension", Turner also notes {{quote|text=I initially called these ''ZF expressions'', a reference to [[Zermelo–Fraenkel set theory]] — it was [[Philip_Wadler|Phil Wadler]] who coined the better term ''list comprehension''.}} Burstall and Darlington's work with NPL influenced many functional programming languages during the 1980s, but not all included list comprehensions. An exception was Turner's influential, pure, lazy, functional programming language [[Miranda programming language|Miranda]], released in 1985. The subsequently developed standard pure lazy functional language [[Haskell programming language|Haskell]] includes many of Miranda's features, including list comprehensions. Comprehensions were proposed as a query notation for databases<ref>[http://portal.acm.org/citation.cfm?coll=GUIDE&dl=GUIDE&id=135271 Comprehensions, a query notation for DBPLs<!-- Bot generated title -->]</ref> and were implemented in the ''[[Heinrich Kleisli|Kleisli]]'' database query language.<ref>[http://portal.acm.org/citation.cfm?id=351241&dl=ACM&coll=portal The functional guts of the Kleisli query system<!-- Bot generated title -->]</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)