2000 · 42 citations · 6 references
ComputingComputer ScienceCompilersProgramming LanguagesTheory Of ComputationCompiler ConstructionFunctional ProgrammingObject-oriented ProgrammingType CheckingType SystemsHigher-order FunctionsObjectsParametric PolymorphismPolymorphic Type SystemsPolymorphic TypesReference CountingSubtype PolymorphismType Constructors
This paper describes FC++: a rich library supporting functional programming in C++. Prior approaches to encoding higher order functions in C++ have suffered with respect to polymorphic functions from either lack of expressiveness or high complexity. In contrast, FC++ offers full and concise support for higher-order polymorphic functions through a novel use of C++ type inference.Another new element in FC++ is that it implements a subtype polymorphism policy for functions, in addition to the more common parametric polymorphism facilities. Subtype polymorphism is common in object oriented languages and ensures that functions in FC++ fit well within the C++ object model.Apart from these conceptual differences, FC++ is also an improvement in technical terms over previous efforts in the literature. Our function objects are reference-counted and can be aliased without needing to be copied, resulting in an efficient implementation. The reference-counting mechanism is also exported to the user as a general-purpose replacement of native C++ pointers. Finally, we supply a number of useful functional operators (a large part of the Haskell Standard Prelude) to facilitate programming with FC++. The end result is a library that is usable and efficient, while requiring no extensions to the base C++ language.
6
Ralph E. Johnson, Brian Foote · Journal of Object-oriented Programming · 1988 · 1.1K citations
Computing, Computer Science, Design +15
Philip Wadler · 1990 · 575 citations · Full text
Martin Odersky, Philip Wadler · 1997 · 419 citations · Full text
Alexander A. Stepanov, Meng Lee · 1998 · 409 citations
A framework for higher-order functions in C++
Konstantin Läufer · 1995 · 36 citations