M
M
Maxim2020-09-29 12:45:03
Erlang
Maxim, 2020-09-29 12:45:03

How is business logic and data model described in functional languages?

Greetings!
I googled a little, but I could not get a clear understanding for myself, but how are business logic and data model described in functional languages ​​​​like Haskell and Erlang?
Is it stored in a database?
And where are the states stored by the way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wiz, 2020-09-29
@max_shane

Technically, you can certainly not describe at all. They gave JSON and spin as you like - in the json database, in the json program, on the json client. But often this is inconvenient and you want to first overtake it into something directly much more specific to the subject area. From {"something": "special"}to Special :: Something. And as many times as it takes to achieve comfortable work. Zero, one or more - I don't think it matters.
I don't know what exactly they said on YouTube, but it's like a question of having some scheme that can be interpreted in different ways for different purposes and at different times.
Can do type

data Something = Special | Ordinary | Composite This That
and then, when unloading, use Generics, typeclasses, TemplateHaskell or something else to get the code that will be transferred from the database to the language.
Business logic is even simpler - code is data, and data is code. There is EDSL at the host language level and you write the logic in Haskell, compile and keep it next to the project. And there are DSLs that do not use runtime and you need to fasten your interpretation and serialization to them and store them anywhere.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question