3 ms·
They're related, but "declarative" is a broader category that includes relations. Functions are a special case of relations (see also: prolog, datalog, sql...).
by epgui 4y ago
They're related, but "declarative" is a broader category that includes relations. Functions are a special case of relations (see also: prolog, datalog, sql...).
- manmal 4y agoYou can write declarative code in an imperative language, and you can write non-declarative code in a functional language (eg IO monad). So IMO they can’t be related. That’s assuming that „declarative“ means „describing outcomes rather than describing process“.
- epgui 4y agoYou can write functional code in an imperative language and you can write imperative code in a language like Haskell, but that’s irrelevant.