[Haskell-cafe] C functional programming techniques?

Maurí­cio CA mauricio.antunes at gmail.com
Fri Jan 29 12:11:29 EST 2010

Hi, all,

Sorry if this looks weird, but do you know of experiences with
functional programming, or "type programming", with C? Using macro
tricks or just good specifications?

I know this is not absurd to a small extent. I've heard of proof
tool certificated C code on the net (although I don't understand
that theory), and I was also able to use what I learned from
Haskell in a few C-like tasks. [*]

So, I imagine if someone has done such kind of experiment
seriously, like others have done with object-oriented programming
(gobject etc.). Google told me nothing.



[*] This may actually be interesting. I had to use a proprietary
script language mixing the worst of FORTRAN and C to drive an
application, and I tried to use what I learned from Haskell by,
say, prohibiting side effects out of some isolated code areas that
got well specified input and gave well specified output -- even
if the inside of the block itself was a huge mess. The result
was actually fun to use, and after two years without looking at
that code I was asked to adapt the application to be used inside
another, which I could do in half a day! Maybe I should write a
"Why functional programming matters - 2" on that :) It's easy to
show FP is cool with abstract problems, but it's far more cool
when we can show it can save even programmers with no CS theory
background from huge headaches.

More information about the Haskell-Cafe mailing list