官术网_书友最值得收藏!

Chapter 1. Embrace the Truth

The history of functional programming can be traced back to the Church and Rosser's original work on Lambda Calculus in 1936 and yet, the concepts and implementation of this important programming paradigm are somehow limited to academia while its object-oriented and imperative counterpart dominates the industry. Good news is, this trend is changing fast! With the functional paradigm support in modern programming languages, such as Scala, Clojure, F#, Ruby, and to some extent, the omnipresent JavaScript, the benefits of functional programming are being realized. The increased use of some classical functional languages, such as OCaml, Erlang, Scheme, and Lisp in high-concurrency environments has led to realization of the functional advantages of brevity, terseness, scalability and performance.

In this chapter, we will cover everything that a hobbyist F# developer, who is just starting his/her adventure in functional programming, needs to know in order to be able to follow the discussion through rest of the book. We will begin with a short explanation of F# language's rather special role in the functional programming world, and will explain why it isn't strictly a functional programming language. Throughout the book, and in this chapter particularly, we will address the historic sketches of functional languages and their predecessors. We will discuss F# language's roots in ML, the context in which F# works, that is, running on top of .NET stack, compiled to IL, utilizing BCL, and the hybrid nature of the languages. You will see several new terms used in this and the following chapters; these terms will have a cursory definition, but will be elaborated on as we discuss these topics in detail during subsequent chapters.

By the end of this chapter, you will be familiar with a brief history of functional programming. With comparative code examples, we will analyze code samples using mutable, and immulatable data structures as well as imperative control flow syntax that will allow you, the reader, to fully understand and embrace the hybrid nature of F#.

In this chapter, we will cover the following topics:

  • A brief overview of Functional Programming Paradigm
  • Thinking functional—why functional programming matters
  • The F# language primer
  • Benefits of functional programming and functional data structures
  • Code samples comparing imperative and functional styles
主站蜘蛛池模板: 宜兰市| 银川市| 锦州市| 南雄市| 五峰| 西平县| 崇义县| 敦煌市| 满洲里市| 新疆| 巴林左旗| 九龙县| 扎鲁特旗| 高邮市| 滨州市| 淳安县| 扶沟县| 光山县| 金乡县| 济南市| 郓城县| 六安市| 永康市| 肇东市| 台安县| 鹤壁市| 长子县| 天津市| 陇南市| 夏河县| 咸丰县| 新巴尔虎左旗| 石城县| 扎赉特旗| 日土县| 建阳市| 麦盖提县| 阳西县| 台湾省| 依安县| 延吉市|