Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala Catalog of functional Design Patterns

Since a week I'm reading Programming in Scala. The authors introduce elements of the language step by step , but I'm still confused when to use the functional things like actors, closures, currying,....

I'm looking for a catalog of typical use cases or best practices for functional contructs.

I don't mean reimplementing well known pattern like GoF in Scala like

  • http://github.com/greedy/scala-study-group/tree/master/patterns/
like image 260
stacker Avatar asked Feb 05 '10 07:02

stacker


1 Answers

Being confused about when to use closures or currying is like being confused about when to use classes. They are just part of the language, and serve any task you put it to. When OO first reached mainstream, pretty much the same question was asked of classes.

As for actors, they are a distributed programming paradigm -- and not, mind you, part of the language itself. They are used when you want to take advantage of concurrency, and your application does not need to share state between concurrent processes, nor is it mainly oriented towards parallel processing.

like image 63
Daniel C. Sobral Avatar answered Dec 04 '22 21:12

Daniel C. Sobral