Non-numerical use cases for functional programming?

前端 未结 18 2148
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-22 21:33

I just finished reading a book on scala. What strikes me is that every single example in the whole book was numerical in some form or another.

Like a lot of programm

相关标签:
18条回答
  • 2020-12-22 21:54

    Check out Text Processing in Python. The book starts out with some simple but well-motivated examples where functional programming techniques make code easier to read and more likely to be correct.

    0 讨论(0)
  • 2020-12-22 21:57

    It's true that many books on functional programming uses "numerical programming" to teach, but there are exceptions.

    Haskell School of Expression is a beginner's book on Haskell that uses multimedia as its vehicle for teaching.

    Real World Haskell doesn't really have any particular vehicle throughout the entire book, but there are several chapters covering writing "real" programs in a functional style.

    0 讨论(0)
  • 2020-12-22 21:59

    We used Haskell to implement a domain-specific language for describing, pricing, and monitoring exotic derivatives.

    0 讨论(0)
  • 2020-12-22 22:00

    "Getting Started with Erlang" has an extensive client/server example (starting in Section 1.3.5) which may suit your needs.

    0 讨论(0)
  • 2020-12-22 22:00

    Ted Neward wrote a 10 part article on Scala, aimed at Java programmers, and the series finished off with writing a DSL in Scala. This particular DSL is actually a numeric calculator, but that's not what's interesting about it, it's the way the DSL can be easily assembled in a functional language

    Part1

    Part2

    Part3

    0 讨论(0)
  • 2020-12-22 22:05

    Really interesting question because I thought I was the only author writing books on functional programming for numerics!

    Functional programming has historically been far more commonly used for metaprogramming, meaning writing programs that manipulate other programs. This includes interpreters and compilers (e.g. for DSLs) as well as more esoteric applications such as theorem provers (Coq, Isabelle) and term rewrite systems (e.g. computer algebra systems like Mathematica). The Meta Language (ML) family of languages were specifically designed for this.

    0 讨论(0)
提交回复
热议问题