Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

After reading both this thread and the linked paper, I don't understand how FRP (functional relational programming) is different from (FP) functional programming.

Does FRP augment or replace FP? Can FRP be implemented as a library in an FP language?

share|improve this question
add comment

1 Answer

Functional relational programming seems to be, just as the name suggests, a blend of both functional programming and the relational model. I think this sentence pretty much sums it up (p. 42):

In FRP all essential state takes the form of relations, and the essential logic is expressed using relational algebra extended with (pure) user defined functions.

Functional programming removes state from the equation and deals only with pure functions (no side effects). This is supposed to make things easier on everyone by preventing data manipulation from being hidden therefore making it easier to reason about the program. FP is a beautiful ideal but in real life applications state is necessary and often useful. It is of course possible to have state in FP it's just a little more involved.

Based on a quick glance at the paper it seems they're trying to simplify FP by allowing state in a tightly controlled manner. Relational data is well structured and easy to reason about and functional programs are easy to reason about (maybe not in the human sense mind you) so let's augment FP with R and make everyone's state-loving live easier.

share|improve this answer
    
Thanks for the response. Sounds like it's as I expected -- not really meaningfully different from FP. What I couldn't figure out was why a lot of people were implementing their own FRP tools, instead of just extending an FP language. –  Matt Fenwick Oct 19 '12 at 13:21
    
@MattFenwick Are you sure you have the right "R" here? There's also Functional Reactive Programming, which is also commonly abbreviated as FRP, and is also a specialization of FP, but is totally unrelated to relational algebra. There are a lot of independent/specialized implementations of FR(eactive)P, but I've never heard of FR(elational)P before. –  Ptharien's Flame Oct 19 '12 at 21:48
    
@flame yes, I'm sure. See the linked paper for more details. –  Matt Fenwick Oct 24 '12 at 15:07
    
One very interesting language to take a look at is Opa - a functional language that offers mutable state bound to (relational or document) database-records, very direct query-syntax and an extremely powerful type-system. It's not a functional-relational language per se, but it might be a suitable language in which to exercise the idea of functional-relational programming. (don't be fooled by how this is branded as a "JavaScript framework" - it is a compiled and unique language unlike anything else I've seen.) –  mindplay.dk May 9 '13 at 12:31
    
PS: thank you @axblount, this is an absolutely beautiful answer! –  mindplay.dk May 9 '13 at 12:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.