Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Purely functional


Related Topics

In the News (Wed 16 Dec 09)

  
  The Miranda Programming Language
Miranda was the successor of the functional languages SASL and KRC.
With Miranda, the main goal was to produce a commercial version of a standard non-strict purely functional language.
In Non-Strict functional languages, the arguments to a function are not evaluated until they are actually required within the functions being called.
www.engin.umd.umich.edu /CIS/course.des/cis400/miranda/miranda.html   (309 words)

  
 Functional Programming HOWTO
Functional programming's avoidance of assignments arose because assignments are difficult to handle with this technique; assignments can break invariants that were true before the assignment without producing any new invariants that can be propagated onward.
Functions don't depend on system state that needs to be replicated before running a test; instead you only have to synthesize the right input and then check that the output matches expectations.
The function is applied to the starting value and the first element of the list, then the result of that and the second element of the list, then the result of that and the third element of the list, and so on.
www.amk.ca /python/writing/functional   (5793 words)

  
 Dr. Dobb's | Mondrian for .NET | April 11, 2002
Functions are first-class values and may be passed as function arguments and returned as results; new functions may be created dynamically.
Functional languages contain no conventional assignment or flow-of-control statements; algorithms are expressed as mappings from input values to output values.
By "purely functional," we mean that the algorithm is defined as the composition of a number of functions.
www.ddj.com /dept/windows/184404967   (3284 words)

  
 ACM OOPS Messenger 4, 3 (July 1993), 18-25.
In particular, while C and C++ offer the ability to pass a function as an argument to another function (i.e., a "funarg"), the functions being passed cannot contain references to variables of intermediate scope (i.e., the functions are not function closures), and therefore they are essentially useless for most mapping processes.
Each iterator function must accept such an iterator type as a "current state" argument, and produce the "next state" iterator type as one of its results; since the state is accepted and manipulated explicitly, the iterator subprogram has no hidden state and hence it is functional.
We have shown how the ability to define higher-order functions (functions which take other functions as arguments) and the ability to define local functions which are closed over their free lexical variables can be used to provide iteration capabilities for abstract collections without the need to define an iterator class for each such collection class.
home.pipeline.com /~hbaker1/Iterator.html   (4560 words)

  
 comp.lang.functional Frequently Asked Questions (monthly posting)   (Site not responding. Last check: 2007-11-06)
Functional languages are gathering momentum in education because they facilitate the expression of concepts and structures at a high level of abstraction.
One definition that has been suggested is as follows: The term "purely functional" is often used to describe languages that perform all their computations via function application.
Parsers are represented by functions and combined with a small set of combinators, leading to parsers that closely resemble the grammar of the language being read.
www.faqs.org /faqs/func-lang-faq/index.html   (6096 words)

  
 CS312 Lecture 17: Side Effects. References.   (Site not responding. Last check: 2007-11-06)
If, however, a function would have access to information that allows it to distinguish internally between its various executions, then the value returned by the function could be made dependent on such information.
It is clear that if our functions had "memory" and could distinguish between their various executions, then the order of function calls becomes critical and the simple world of referential transparency is lost.
Note that the order and number of function calls that we perform is not indifferent if we allow for side effects - the result of our small program depends on whether we replace certain subexpressions with their values or not.
www.cs.cornell.edu /courses/cs312/2004fa/lectures/lecture17.htm   (1437 words)

  
 FAQ for comp.lang.functional
Comp.lang.functional is an unmoderated usenet newsgroup for the discussion of all aspects of functional programming languages, including their design, application, theoretical foundation, and implementation.
Functional programming is a style of programming that emphasizes the evaluation of expressions, rather than execution of commands.
The term "purely functional" is often used to describe languages that perform all their computations via function application.
www.cs.nott.ac.uk /~gmh/faq.html   (5762 words)

  
 [No title]   (Site not responding. Last check: 2007-11-06)
In OCaml, the symbol tables are purely functional maps, with only one reference holding the current stable symbol table.
Using purely functional data structures, the program is often a direct transliteration of the specs.
There are techniques to reason about imperative programs directly, but often a rewrite to a purely functional style makes it easier to "import" the program into a proof checker such as Coq and prove properties about it.
merd.sourceforge.net /pixel/language-study/various/pure-data-structures-advantages   (681 words)

  
 Functional Programming
the functional programming approach differs from the traditional and current mainstream approaches to programming: it is more mathematical in flavor and amenable to logical proof
functional programs are much more concise than their traditional counterparts: whether this makes them easier to understand is a matter of training and "mathematical sophistication"
many functional languages support the definition of initial algebraic data types: these are a generalization of context-free term structures, but with overt tags on alternatives
www.willamette.edu /~fruehr/talks/ling/clltalk7.html   (189 words)

  
 Twisted Radix: Functional optimizations with PyPy
So frames created for this function can tell the cyclic garbage collector to go away, and any objects that that function creates don't need to take part in the cyclic garbage collector.
If the function does not later return this value, either as a returned value, or by assigning it to a more global variable, then that function is responsible for properly disposing of any of the resources controlled by the value--even in the case of exceptions.
Anyway, the benefits of knowing when some code is functional is pretty well-documented, mostly in academic papers and implementations of obscure languages like haskell and scheme ;-) The GC optimizations are only one aspect, from what I can tell, although most of them are probably related to memory management.
radix.twistedmatrix.com /2006/10/functional-optimizations-with-pypy.html   (838 words)

  
 MLunzip: an SML implementation of RFC1951
This is an implementation of gunzip (the decompression side of RFC1951/2) in a purely functional subset of Standard ML.
Of course, it's not expected a functional implementation would be as fast as the C one, the question is more whether the cost of using a higher level language is acceptable.
If the aim was not to remain purely functional, and the language provides an escape hatch to mutable arrays, this is the obvious data structure for output lookups.
www.nenie.org /functional/mlunzip.html   (818 words)

  
 Diary for johnnyb
However, purely functional languages wouldn't have the ability to do full compile-time programming - at least not with the same semantics as the rest of the language - simply because then it would cease to operate in a purely functional manner.
So, I wrote a function make-counting-comparator which took a normal comparator and spit out one that was a vector of three functions over the same closure - one function reset the counter, one did the comparison, and one retrieved the value of the counter.
You could use a similar function to the make-counting-comparator function with a continuation argument, and even create a wrapper function to ensure that the whole thing is functional, however, it will still rely on side-effects underneath to carry it out.
www.advogato.org /person/johnnyb/diary.html?start=67   (1980 words)

  
 [Nickle]"purely" functional nickle (was: Recursive datatypes)
He starts with a single function to double each element in a list, then progressively decomposes it in order to arrive at a definition for map.
This compose is restricted to accepting one function with two arguments and a second with one argument.
Oh, and in a similar vein, is there any way to call one function with a variable length argument list from another that also has a variable length argument list.
keithp.com /pipermail/nickle/2002-July/000117.html   (427 words)

  
 XML.com: Functional Programming and XML
It's natural to think of XML documents as trees, and functional languages tend to have lots of nifty facilities for representing and manipulating trees.
Functions are to FP what objects are to OOP.
While there are many ways to classify functional languages according to technical features and formal properties, such divisions tend to be more useful to the FP experienced, degenerating into mere buzzwords for the novice.
www.xml.com /pub/a/2001/02/14/functional.html   (1070 words)

  
 Ask Reddit: What the hell are monads? (reddit.com)
In Haskell, a purely functional language, we use monads to provide a library-based approach to sequential, imperative evaluation: the famous IO monad.
This is necessary in languages such as Haskell because they're so-called "pure functional programming languages" in that they don't allow functions to generate side-effects (a function takes inputs, returns an output, and that's it).
Functional languages are typically related to the lambda calculus, which doesn't bear a whole lot of resemblance to integral/differential calculus, other than the word 'calculus' being used in their names.
programming.reddit.com /info/ox6s/comments   (5792 words)

  
 Everything Your Professor Failed to Tell You About Functional Programming
Somewhere, somebody is going to hate me for saying this, but if I were to try to explain monads to a Java programmer unfamiliar with functional programming [4], I would say: "Monad is a design pattern that is useful in purely functional languages such as Haskell.
The successively nested anonymous functions used in the add function are perhaps a bit difficult to understand, but this is a literal translation of how it would work in Haskell.
Purely functional programming languages such as Haskell are very strict in their approach to side effects.
www.linuxjournal.com /node/8850/print   (2822 words)

  
 Everything Your Professor Failed to Tell You About Functional Programming | Linux Journal
functional programming, I would say: "Monad is a design pattern that is useful in purely functional languages such as Haskell.
Okay, so a monad is a design pattern that can be used to encapsulate some functionality that will generally work on any type (otherwise generalizing the functionality wouldn't be helpful, since you would have to still deal with all the different types).
The block is the part of the functionality that you are encapsulating in the monad (potentially w/ side effects) and the function that takes the monad calls "pass" (or yield) to get that functionality executed on the values passed to it.
www.linuxjournal.com /article/8850   (7191 words)

  
 Purely Functional Data Structures - Cambridge University Press
This book describes data structures from the point of view of functional languages, with examples, and presents design techniques that allow programmers to develop their own functional data structures.
All source code is given in Standard ML and Haskell, and most of the programs are easily adaptable to other functional languages.
This handy reference for professional programmers working with functional languages can also be used as a tutorial or for self-study.
www.cambridge.org /us/catalogue/catalogue.asp?isbn=0521663504   (258 words)

  
 Slashdot | Purely Functional Data Structures
Each parameter to a function, for example, is passed as a "thunk" of code, not a value.
So forgive me for not telling you why functional programming is good (This paper is one famous attempt), but perhaps a better question to focus on is "Why should you spend the time to investigate this?" The best answer I can give is that it leads to a whole new way of thinking about programming.
Functional programming is a different paradigm than imperative programming, and as such, you have to think differently.
books.slashdot.org /books/04/02/19/2257203.shtml   (7236 words)

  
 Everything Your Professor Failed to Tell You About Functional Programming (reddit.com)
Regarding your comment on languages that are "purely X," which seems to be a reference to Haskell, often described as "purely functional," I should point out that Haskell is not limited to purely functional programming paradigms.
So you can be pure and impure in the same program, using each approach where it makes sense, all while being assured that neither side of the program is muddying the other.
In sum, the line between "purely X" and "not purely X" is rather easy to cross, and not as strongly separating as many people seem to believe.
reddit.com /info/15y2/comments   (1384 words)

  
 Chris Hanson - Haskell and functional programming.
I'm particularly interested in the way Haskell uses monads to represent non-functional aspects (I/O and other state changes) without introducing side effects to the language itself or compromising its purely functional nature.
Functional programming quite different from object-oriented programming, which is all about state manipulation (after all, OOP is "programming by sending messages to objects").
On the other hand, pure functional programming and pure object-oriented programming have a lot of the same "values" underneath them: Leverage the type system to do most of the work in modeling your problem domain, and when you write code, write it in very small, concise, discrete units that each express one concept clearly.
chanson.livejournal.com /156835.html   (196 words)

  
 96-06: Purely Functional Representations of Catenable Sorted Lists   (Site not responding. Last check: 2007-11-06)
The power of purely functional programming in the construction of data structures has received much attention, not only because functional languages have many desirable properties, but because structures built purely functionally are automatically {\em fully persistent}: any and all versions of a structure can coexist indefinitely.
For one purposes, a purely functional data structure is one built only with the LISP functions car, cons, cdr.
The representations we present are the first that address the issues of persistence and pure functionality, and the first for which fast implementations of catenation and split are presented.
dimacs.rutgers.edu /TechnicalReports/abstracts/1996/96-06.html   (239 words)

  
 comp.lang.functional Frequently Asked Questions   (Site not responding. Last check: 2007-11-06)
Functional Programming Languages in Education (FPLE), the first meeting of which was held in Nijmegen, The Netherlands, December 1995.
Some functional language implementations support tools that generate a parser automatically from a specification of the grammar (in much the same way that a C programmer uses yacc).
The term `purely functional language' is often used to describe languages which perform all their computations via function application.
www.cs.ui.ac.id /staf/wp/scientific-materials/functional/fun_faq.html   (6045 words)

  
 Chris Okasaki's Publications
Most implementations of finite maps in functional languages are based on balanced binary search trees, which perform well on the first two, but poorly on the third.
Although some data structures designed for imperative languages such as C can be quite easily adapted to a functional setting, most cannot, usually because they depend in crucial ways on assignments, which are disallowed, or at least discouraged, in functional languages.
As an example of this technique, we present a purely functional (and therefore persistent) implementation of lists that simultaneously support catenation and all other usual list primitives in constant amortized time.
www.eecs.usma.edu /webs/people/okasaki/pubs.html   (2991 words)

  
 Purely Functional Data Structures - Cambridge University Press
This book describes data structures from the point of view of functional languages, with examples, and presents design techniques so that programmers can develop their own functional data structures.
It includes both classical data structures, such as red-fl trees and binomial queues, and a host of new data structures developed exclusively for functional languages.
All source code is given in Standard ML and Haskell, and most of the programs can easily be adapted to other functional languages.
www.cambridge.org /aus/catalogue/catalogue.asp?isbn=0521663504   (170 words)

  
 CS312 Lecture 21: Side Effects and References
The assignment operator is an example of a function that is interesting only for its side effect; the value it "computes" is trivial.
For example, one could redesign each "expensive" function to receive both the current arguments and the set of all values they computed in the past.
Then the function would either look up the value that corresponds to the current arguments (if it is available), or it would compute the value from scratch.
www.cs.cornell.edu /Courses/cs312/2002fa/lectures/lec21.htm   (1041 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.