Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you design a functional program? [closed]

From day 1 of my programming career, I started with object-oriented programming. However, I'm interested in learning other paradigms (something which I've said here on SO a number of times is a good thing, but I haven't had the time to do). I think I'm not only ready, but have the time, so I'll be starting functional programming with F#.

However, I'm not sure how to structure much less design applications. I'm used to the one-class-per-file and class-noun/function-verb ideas in OO programming. How do you design and structure functional applications?

like image 859
Thomas Owens Avatar asked Oct 10 '08 16:10

Thomas Owens


People also ask

What is functional program design?

Functional programming refers to programming computers where functions serve as the primary mechanism for manipulating data. A function is said to be pure when it takes inputs, manipulates those inputs, and returns output, all without having to store some temporary or external state.

Are there design patterns for functional programming?

In object-oriented development, we are all familiar with design patterns such as the Strategy pattern and Decorator pattern, and design principles such as SOLID. The functional programming community has design patterns and principles as well.

How does a functional program work?

Functional Programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. In functional code, the output value of a function depends only on the arguments that are passed to the function.

Do solid principles apply to functional programming?

Are the SOLID principles applicable to Functional Programming? Of course. Functional programmers want to separate their code to avoid crosstalk between responsibilities and users. They want to minimize the number of modules affected by a change.


1 Answers

Read the SICP.

Also, there is a PDF Version available.

like image 126
Paul Nathan Avatar answered Sep 28 '22 13:09

Paul Nathan