Something about Functional Programming

Hello, everyone! I do hope that the standard library can absorb some basic tools in FP (Functional Programming). For example, the standard library can provide the full implement of algae(ADTs together with monads and so on) and thunk(laziness).

1 Like

Lazyness is already there, to a certain level at least, you can find it in the Stream module.

Also, nothing of the things you mentioned is necessary for a language to be FP, nor does a language need to be FP to make use of Algebraic Datatypes or lazyness.

But perhaps I got you wrong and you can get a bit more into detail what you actually mean.

There is also

and

Both by expede.

And a related talk by the author

3 Likes

Ofc. They are not necessary…But it may be more convenient, I suggest. And, maybe it is just alright to include them in Hex for now…

Putting all those stuff into the stdlib, would put a lot of a burden to the core team. Also all that typeclassopedia mumble coming along with ADTs (Functors, Applicatives, Monoids, Monads et al.) is scarying newcommers.

When I was in FP class, I’ve seen a lot of students that grasp the syntax of Haskell easily, but had hard trouble to understand everything beyond the differences between sum and producttypes.

Therefore I conclude that putting those tools into the stdlib as a mandatory tool would make it hard for newcomers to get into elixir, while putting them there as optional tools would put the burden of maintanance on the core team while users wont use them that much.

1 Like

Jose blogged about FP in elixir a while back.

FP is great, but it’s not the end goal, it’s a means to building concurrent and fault tolerant systems.

3 Likes

Ok, I understand now.