

The “Thinking Functionally” Series - glazskunrukitis
http://fsharpforfunandprofit.com/series/thinking-functionally.html

======
laichzeit0
Kinda off topic but it's a pity about the choice of F#, even though it might
be a fantastic functional language. I just can't find myself willing to invest
time learning a language that's basically locked to a single operating system.

Most of my work is on software that runs on big iron unix systems and I
suspect Mono would be a tough to impossible sell in large enterprise due to
lack of professional services and support. Hell it's impossible to even sell
the idea of putting Linux on some of the systems unless it's RHEL.

~~~
obviouslygreen
... _it's a pity about the choice of F#_...

Exactly what I was thinking. I know functional programming is interesting to
me, and from experience I know that learning a new paradigm can improve your
competence as a developer, but I have the same reservations about learning a
language I'm pretty sure I won't have a realistic chance to actually use.

If there are similar resources in Haskell or Erlang... now that I could
convince myself to spend some time on.

~~~
kyllo
I've studied some ML and as far as I can tell, F# is basically just ML plus
access to CLI libraries and support for CLI-specific data structures,
generics, etc. Awesome if you're a .NET developer, but if you aren't, then
there's not much of a point in learning F#--but SML and OCaml are basically
equivalent options.

F#, SML, and OCaml are basically one functional language family, while Haskell
and Erlang are in completely different families. And then there's the
Lisp/Scheme family, which is again quite different.

~~~
obviouslygreen
Interesting! All I know about .NET is that the native ORM is apparently
awesome (second-hand opinion, no less, and I can't even correctly recall its
name).

I learned a little Scheme to try and help a friend while I was in college, but
that's about the extent of my exposure to functional languages... it seems
like a real shame that this style of development is apparently so highly-
regarded but doesn't get much attention in early programmer education.

I definitely see the utility of OOP, and as far as marketability goes it's
still the good bet, but it'd be great to see better resources for functional
programming.

~~~
kyllo
LINQ is the name of what you're describing.

The ML family is quite different from Scheme. ML's salient feature is its
powerful type checking system. It allows you to almost eliminate runtime
errors.

Functional programming used to get much more attention from universities than
it does now. So did C. Now they're trending toward doing everything in Java,
which is what industry seems to want, but it's dumbing down the education.

Classic rant post about this phenomenon can be found here:
[http://www.joelonsoftware.com/articles/ThePerilsofJavaSchool...](http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html)

~~~
obviouslygreen
Yep, that's the one! Thanks again. Despite often not totally agreeing with
Joel, I taught myself and my classmates C and then C++ in high school, re-
learned C++ in college, and am one of those people who railed against Java as
a replacement.

My knee-jerk reaction would be that functional programming isn't an important
skill for industry... but then neither are the low-level RDBMS classes I took
as requirements, and I'm sure a lot of other people could chime in with "US
university failed to prepare me for work" stories of their own, so that's
beaten to death.

I'm getting over my reactive Java loathing thanks to Android, but man, it'd
still be nice to get people learning functional _and_ procedural _and_ object-
oriented programming.

~~~
laichzeit0
What's fantastic about Java is not the Java language but that you now get a
JVM for just about every platform. You have Java, Groovy, Scala, Closure, etc.
all these programming languages you could pick from and you get cross-platform
support for free as well as being able to use all the thousands of Java
libraries that are already out there. It's a powerful combination.

------
kvb
This looks like a great resource for people new to functional programming. One
thing that I wish more F# web sites would look into, though, is using Tomas
Petricek's awesome formatting tools [1][2], which give you tooltips for F#
code on the web. This makes reading F# code on the web a lot more like reading
F# code in an IDE, and makes it much easier to understand what's going on in
some examples.

[1] Formatting F# code for the web - <http://tomasp.net/blog/fswebsnippets-
intro.aspx>

[2] Announcing - Literate programming tools for F#

------
crazygringo
Slightly tangential, but does anyone know of a good tutorial/explanation of
real-life functional programming in designing apps? For example, building a
fully AJAX-enabled, MVC-style web app in a functional manner?

I still really want to get "into" functional programming, but all the
tutorials I find seem to be awfully mathematically-oriented or theoretical.
For me to really "grok" it as it might apply to my life, I'm still trying to
get how to combine it with webapps or CRUD-type apps. Even back-end would be
fine -- how to write a web server written "functionally", that retrieved data
from a database and turned it into JSON format, for example.

~~~
tomku
Check out "Monadic Design Patterns for the Web"[1]. I haven't read it yet, but
the description sounds like exactly what you're looking for.

I don't think you're going to find an escape from the theory, though... the
abstractions that are necessary to adapt functional programming to something
like a CRUD app are going to be mind-bending, one way or another. It might be
easy to write something simple up in Yesod or Snap, but that's only because
the framework authors are doing most of the abstraction-herding for you. From
what I can tell, that book goes into the messy details.

[1]: <http://www.artima.com/shop/monadic_design_patterns>

------
cookingrobot
Why do they demand that functions only have one input? They claim that it's
because that's how functions work in math, but that's not the case.
<http://en.wikipedia.org/wiki/Multivariable_calculus>

