How do functional programming languages work?

Posted by eSKay on Stack Overflow See other posts from Stack Overflow or by eSKay
Published on 2010-05-01T19:30:50Z Indexed on 2010/05/01 19:37 UTC
Read the original article Hit count: 435

I was just reading this excellent post, and got some better understanding of what exactly object oriented programming is, how Java implements it in one extreme manner, and how functional programming languages are a contrast.

What I was thinking is this: if functional programming languages cannot save any state, how do they do some simple stuff like reading input from a user (I mean how do they "store" it), or storing any data for that matter?

For example - how would this simple C thing translate to any functional programming language, for example haskell?

#include<stdio.h>
int main() {
    int no;
    scanf("%d",&no);
    return 0;
}

© Stack Overflow or respective owner

Related posts about object-oriented-design

Related posts about functional-programming