Learning from Haskell

There is an essential distinction between learning a language to apply it directly and learning from a language to gain insight into how things can be done differently with what we use today.

I am learning from Haskell.  Why do I say learning from rather than simply learning?  The purpose of this process is to inform my approach to software architecture with Java.  This may sound incredibly dull.  It certainly would have to me several years ago, but I have seen first hand the value of learning from programming languages and paradigms rather than assuming they must be applied directly.  There is also the all to present reality that converting an organization from one programming language to another is largely an exercise in tilting at windmills.

My most poignant past experience in learning from a language was through Erlang and OTP.  After having learned Erlang and OTP and having done several personal projects with it I had the nugget of a major breakthrough that I could apply at work without changing our technology.  This nugget was that the essence of a fault tolerant system is one which guarantees consistent state on failure.  OTP's "Let it Fail" philosophy makes it easier to provide these guarantees since there are far less partial recovery states to consider.  Once you have a guarantee of consistent state on failure and you let it fail you can also trivially let the system restart at any level of granularity.  This lets you provide fun properties like having a system that seamlessly continues where it was in an long batch process after an system update has rebooted the server or after a power outage.

That was Erlang and OTP.  What do I hope to gain from Haskell?  In fact it doesn't matter much what I gain.  Of course I hope for a major breakthrough, but I specifically aim to understand type classes and the potential impact that a similar technique could have on Java data model refactoring.  I will be more than happy to have a passing understanding of how software is built in with such radically different constraints available.

So far I am very happy with getting back into Haskell and I think it has a lot to do with the fact that I am going in with more realistic expectations of what I will gain in the process.