"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中字符串,数字之间转换的常用方法

    var number={ num:, num1:"2你好" }; //将数字转换为字符串 var str=number.num.toString();//十进制 );//二进制 ) ...

  2. javascript 同步加载与异步加载

    HTML 4.01 的script属性 charset: 可选.指定src引入代码的字符集,大多数浏览器忽略该值. defer: boolean, 可选.延迟脚本执行,相当于将script标签放入页面 ...

  3. 图解Windows Server 2012 桌面图标

    显示桌面图标.壁纸等   1 WIN键+R键,输入:  rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0 选择你需要的图标显示到桌面去,如下图所示 ...

  4. 在ASP.NET开始执行HTTP请求的处理程序之前

    using Dscf.Client.Web.Class; using Dscf.Client.Web.DscfService; using Dscf.Client.Web.Handler; using ...

  5. C# 调用控制台程序,并获取输出写入文件

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.I ...

  6. Oracle定时器执行多线程

    what里面加下面代码强制执行多线程   begin  execute immediate 'alter session force parallel dml parallel 16';  pkg_s ...

  7. 安装C-Kermit串口访问开发板

    linux下的串口调试工具主要有minicom和kermit. minicom的安装与使用见博文: http://www.cnblogs.com/tanghuimin0713/p/3562218.ht ...

  8. 在信号处理函数中调用longjmp

    错误情况及原因分析 前两天看APUE的时候,有个程序要自己制作一个sleep程序,结果在这个程序中就出现了在信号处理函数中调用longjmp函数的情况,结果就出现了错误,具体错误是啥呢,请参见下面这段 ...

  9. sublime几个有用的快捷键

    几个有用的快捷键:Ctrl+D:选择多个相同字符串进行修改.选中字符串,按住Ctrl+D,继续选中下一个.Ctrl+Shift+L:将选中的内容切割成多行,然后每一行可以同时编辑Ctrl+J:将已选择 ...

  10. ASP.NET MVC4学习笔记路由系统实现

    一.路由实现 路由系统实际是一个实现了ASP.NET IHttpModule接口的模块,通过注册HttpApplication的PostResolveRequestCache 事件对Url路由处理.总 ...