[erlang-questions] "Design patterns" for functional languages?

Kevin Scaldeferri <>
Wed Aug 6 23:15:13 CEST 2008


On Aug 5, 2008, at 11:46 PM, David Mitchell wrote:

> I'm not sure I agree with the statement quoted by Michael that FP
> doesn't have the shortcomings of OO so GoF-like patterns aren't
> necessary.


Yeah, functional programming has _different_ patterns, not no  
patterns.  And, in some sense they also highlight shortcomings.

For example, functional languages typically do not have lists that you  
can append to efficiently, so we need the "Accumulate and Reverse"  
pattern.

Erlang doesn't allow you to enumerate the messages a process can  
receive, so we have a "Hide Message-Passing Behind Functions" pattern.


I'm sure others can pitch in with more examples.

-kevin



More information about the erlang-questions mailing list