"I know why you're here. ...why you hardly sleep, why night after night, you sit by your computer."

Features of Haskell

  • Purely functional
  • Statical typed
  • Lazy
1. Purely functional
  • Every input has a corresponding output
  • f(x) = x² + 1
  • Powerful function compositions

    g(x) = x - 1

    g(f(x)) = x²

  • PURE

    That means no side effects

    A function will never modify a global variable

    Order doesn't matter!

    Easy concurrency

Functional:

Haskell, Lisp, ML, Scheme, Erlang

Focuses on the high-level "what"

Imperative:

C++, Java, Python, Pascal

Focuses on the low-level "how"

2. Statically Typed
  • f x = x² + 1
  • f :: Int → Int
  • There is never confusion about types

    (Bool, Int, Char, etc)

  • Strong formalism. The proof is the code.
  • If your code compiles, you're 99% done
3. Lazy?
  • Nothing is evaluated unless necessary

    The list will only be sorted enough to find the minimum

  • Allows infinite data structures

Introduction to Haskell的更多相关文章

  1. 初识Haskell 五:自定义数据类型和类型类

    对Discrete Mathematics Using a Computer的第一章Introduction to Haskell进行总结.环境Windows 自定义数据类型 data type de ...

  2. 初识Haskell 四:函数function之二 常见函数

    对Discrete Mathematics Using a Computer的第一章Introduction to Haskell进行总结.环境Windows,关于函数的部分太长了,分开写. 常用的对 ...

  3. 初识Haskell 三:函数function

    对Discrete Mathematics Using a Computer的第一章Introduction to Haskell进行总结.环境Windows 函数毫无疑问是函数式语言的核心. 在Ha ...

  4. 初识Haskell 二:基本操作符、类型Type、数据结构

    对Discrete Mathematics Using a Computer的第一章Introduction to Haskell进行总结.环境Windows 1. 在安装了ghci后,便可以进行Ha ...

  5. (转)Awesome Courses

    Awesome Courses  Introduction There is a lot of hidden treasure lying within university pages scatte ...

  6. Github上的1000多本免费电子书重磅来袭!

    Github上的1000多本免费电子书重磅来袭!   以前 StackOverFlow 也给出了一个免费电子书列表,现在在Github上可以看到时刻保持更新的列表了. 瞥一眼下面的书籍分类目录,你就能 ...

  7. Github 的一个免费编程书籍列表

    Index Ada Agda Alef Android APL Arduino ASP.NET MVC Assembly Language Non-X86 AutoHotkey Autotools A ...

  8. Haskell 参考资料

    1.Haskell 中文社区:www.haskellcn.org 2.Haskell   官网:     www.haskell.org 3.Haskell   函数查询:www.haskell.or ...

  9. [2017.02.21] 《Haskell趣学指南 —— Learning You a Haskell for Great Good!》

    {- 2017.02.21 <Haskell趣学指南 -- Learning You a Haskell for Great Good!> [官网](http://learnyouahas ...

随机推荐

  1. js DOM的几个常用方法

    <div id="div1">这是个测试</div> <p </p> <p </p> //js DOM的几个常用方法 / ...

  2. 【MySQL】Event事件与游标

    MySQL的事件就像Linux系统上的定时任务,按照设置的时间或者间隔时间执行设置好的任务. 如果用SQLyog一类的写存储过程.触发器或者事件会省事一些,例如SQLyog就会生成一个大致的模板: D ...

  3. 【MVC】ASP.NET MVC HtmlHelper用法大全

    1.ActionLink <%=Html.ActionLink("这是一个连接", "Index", "Home")%>   带 ...

  4. 【linux】 静态库编译

    文件如下: root@ubuntu:/home/test# ll total drwxr-xr-x root root Sep : ./ drwxr-xr-x root root Sep : ../ ...

  5. Mybatis多条件查询

    在Mybatis多条件查询中: 1.参数如果是多条件,则需要将将添加到Map集合中进行传入. 2.就是将其参数用有序数字进行代替. Mybatis单个String类型参数传递 mysql文如下,传入参 ...

  6. Rich控件一

    Calendar控件 Calendar控件用来在Web页面中显示日历中的可选日期,并显示与特定日期关联的数据. 控件声明代码如下: <asp: Calendar id=" Calend ...

  7. php-resque学习笔记二(配置)

    1:前提 系统:CentOS PHP版本:PHP7     安装目录:/usr/local/php php-resque          安装目录:/home/software/php-resque ...

  8. POJ C程序设计进阶 编程题#3:运算符判定

    编程题#3:运算符判定 来源: POJ (Coursera声明:在POJ上完成的习题将不会计入Coursera的最后成绩.) 注意: 总时间限制: 1000ms 内存限制: 65536kB 描述 两个 ...

  9. datagridview下拉框

    下面介绍Winform中DataGridView的DataGridViewComboBoxColumn的使用方法: //首先获取数据源 //自己建立的静态数据源,你也可以从数据库读取 DataTabl ...

  10. 如何在linux中配置PHP环境

    yum -y install httpd php mysql mysql-server php-mysql//安装mysql扩展yum -y install mysql-connector-odbc( ...