Curried function 2026-10-31
In functional programming, currying represents a function of several arguments as successive one-argument functions. In Haskell, arrows associate to the right:
a -> b -> c means a -> (b -> c). Supplying an argument of type a therefore returns a function of type b -> c, while a function of type (a,b) -> c expects a tuple. Uncurrying converts the first representation to the second. Functional programming 2026-10-13
The eight-page Preliminary Examination in Computer Science, Paper 1, Long Vacation 2003. Original source: Released examination archive, member
4213-1.pdf. Printed pp. 2–3 cover functional programming, p. 4 covers algorithms, pp. 5–6 cover imperative programming, and pp. 7–8 cover digital electronics. The timing diagram on printed p. 8 permits a new clock cycle pulse immediately after a cycle that rearms the circuit.Released examination archive, member
4208.pdf. The original eight-page paper identifies the preliminary examination held on 17 June 2014. Questions 1–4 concern functional programming and Questions 5–8 concern analysis of algorithms. Question 5(b) permits signed integers but prints a bound containing ; for nonpositive inputs the meaningful extension uses . Haskell 2026-10-24
A functional programming language with parametric polymorphism and lazy evaluation. The code examples here use the Haskell 2010 Language Report specification.
Michael R. Clarkson 2026-10-14
Portrait of Michael R. Clarkson
. Portrait identified on the Cornell University profile.This is the 13 June 2017 preliminary examination. Questions 1–4 concern functional programming; Questions 5–8 concern algorithm design and analysis of algorithms. All 35 printed subparts are answered. Source paper: released examination archive, member
a10097w1-1.pdf.The Haskell definitions use separate question namespaces. For Question 1, hide the locally defined names with
import Prelude hiding ((.), zipWith, uncurry); for Question 4 use import Prelude hiding (scanl). Alternative solve definitions are alternatives, not simultaneous duplicate declarations. Assume finite total puzzle inputs; infinite streams and partial values are treated explicitly where relevant. Operation counts separate numeric bit costs from list and comparison steps.[ref]This is the 12 June 2018 preliminary examination. Questions 1–4 concern functional programming; Questions 5–8 concern algorithm design and analysis of algorithms. Every printed option is answered here. The complete nine-page native paper is preserved in the Oxford examination release, member
a10097w1.pdf; the damaged duplicate rendition is not the source used here.The Haskell definitions below use finite total inputs unless lazy evaluation, strict functions or infinite lazy lists are being discussed. Separate questions use separate namespaces: in particular their
One constructors are unrelated, and the list-conversion function abs in Question 3 is distinct from the numeric Standard Prelude function. Treat alternative definitions of the same function separately. In a module for Question 2, use import Prelude hiding (zip, zipWith); in one for Question 3, use import Prelude hiding (abs, reverse, (++)). Other questions retain the Standard Prelude operations they use.[ref] Costs count constructor, comparison and ordinary arithmetic operations; integer bit costs and evaluating arbitrary element values are separate.Choose each team once using
teams, then scan every match with that team as the reference perspective:data Results = Results Team [(Int,Int)]
extract :: [[Match]] -> [Results]
extract days = [Results t (scores t) | t <- teams days]
where
games = concat days
scores t = concatMap (contribution t) games
contribution t (Match a ga b gb)
| t == a = [(ga,gb)]
| t == b = [(gb,ga)]
| otherwise = []In a valid match the teams are distinct. The first guard records the first team's goals-for and goals-against; the second reverses that perspective for the opponent. The common
games binding preserves day/match order, although the result does not need a chronological ordering condition. Each team receives exactly one record because teams has no duplicates. The algorithm makes one scan per team; it deliberately prioritizes a transparent functional programming definition over an unrequested performance improvement. Python (programming language) 2026-10-13
A programming language whose standard-library
ast module provides access to its abstract syntax trees. The examples here use its version 3.14 schema and literal integer arithmetic. Scala 2026-10-24
A programming language supporting object-oriented programming and functional programming. Its traits support reusable mixin behavior, while type variance controls how parameterized types participate in subtyping. The Scala 2 and Scala 3 language versions differ in some syntax and typing details; examples should state the version relevant to a particular claim. Official documentation: docs.scala-lang.org
