Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Functional paradigm design [closed]

I have been asked to capture the design of the system that is implemented by applying functional programming principles in C#. Requirements for this are to use any kind of formalism to describe the design, rather than informal English. Also, usage of UML is forbidden.

I have chosen to try using F# for these purposes, but am having difficulties to keep abstraction level high without going into re-implementation of everything using F#.

So I have few questions:

  1. Is there any architectural framework/practice how to describe functional design?

  2. How can I expose methods without implementation details?

  3. How to create component interfaces in F#?

  4. In OO you usually have different views for architecture (like 4+1, for example). Is there something like that for functional design?

like image 564
Mia Avatar asked Apr 07 '17 13:04

Mia


People also ask

What is functional design paradigm?

Functional Design is a paradigm used to simplify the design of hardware and software devices such as computer software and, increasingly, 3D models.

What is functional programming paradigm?

Functional programming is a paradigm of building computer programs using expressions and functions without mutating state and data. By respecting these restrictions, functional programming aims to write code that is clearer to understand and more bug resistant.

Do you need design patterns in functional programming?

In a functional language one does not need design patterns because the language is likely so high level, you end up programming in concepts that eliminate design patterns all together. The main features of functional programming (FP) include functions as first-class values, currying, immutable values, etc.

Are there functional design patterns?

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.


1 Answers

TLDR it's all about composition.

Everything where you are required to use HKT (think of them as Generic Generics) is mostly a huge asset for library design, when you're going for pure functional programming it's fundamentally different than the GO4 mindset, or the new buzzword of the week for enterprise programming.

Learn Haskell, learn about Monads, Functors, Applicatives, Monoids, etc.(Don't be scared you've used them over 9000 times by now without realizing it) Then look into stuff like the Free Monad, scrap your boiler plate, lenses, Typeclasses, and MTL style transformers and afterwards you'll be a much better library programmer.

like image 159
XGoVoid Avatar answered Oct 14 '22 07:10

XGoVoid