News for hackers. Stuff that matters.
Re:The general value of typed functional programming lies in... by phibz on Monday February 24, 2020 @12:45PM (#22406313)
For me the value of typed functional programming has been it's ability to encode business logic in to the type system and thus validate some of my logic at compile time.
Re:The general value of typed functional programming lies in... by Naac on Monday February 24, 2020 @12:50PM (#22406370)
What's specifically functional about this advantage. Can't you encode the buisness logic into types in non-functional languages as well?
Re:The general value of typed functional programming lies in... by hellofunk on Monday February 24, 2020 @01:04PM (#22406506)
The word “type“ has a fairly different meaning in functional programming compared to object oriented programming. At a very shallow level, they have some similarities. But the way they are used is vastly different between the two paradigms.
Re:The general value of typed functional programming lies in... by eru on Monday February 24, 2020 @12:54PM (#22406425)
The type systems that are common in functional languages are usually more flexible and useful than what you find in most other common languages (in particular, usually more useful than the type systems of common object oriented languages).
Re:The general value of typed functional programming lies in... by ativzzz on Monday February 24, 2020 @01:58PM (#22407157)
You can encode it, but it is not enforced. For instance, I can refer to every instance/argument when I use a Person object as `person` or whatever name of the class is, but when you have many developers working on a large system, these things tend to slowly spiral unless you establish strict guidelines early on and enforce through code reviews.

Or you can use types where it's enforced by the compiler.

Re:The general value of typed functional programming lies in... by marcosdumay on Monday February 24, 2020 @04:48PM (#22408812)
On practice, no you can't. At least today.

But it may be a very interesting question for a researcher.

Re:The general value of typed functional programming lies in... by pepper_sauce on Tuesday February 25, 2020 @05:29AM (#22412135)
Something about putting business logic in a type system irks me more than someone building another compiler or database in Haskell.

Business logic relies so much on run-time values that (IMO) using data and predicates is a better fit.