"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. AX 利用windows粘贴板功能实现批量数据快速导出EXCEL

    static void test(Args _args) { int lineNum; int titleLines; SysExcelApplication excel; SysExcelWorkb ...

  2. libpcap报文解析: ipv4、ipv6(待优化)

    #include <string.h> #include <stdlib.h> #include <pcap.h> #include <netinet/in. ...

  3. 十九、利用OGNL获取ValueStack中:根栈和contextMap中的数据

    利用OGNL获取ValueStack中:根栈和contextMap中的数据 原则:OGNL表达式如果以#开头,访问的contextMap中的数据 如果不以#开头,是访问的根栈中的对象的属性(List集 ...

  4. 音乐社交APP源码 V1.1

    1.关于音乐曲库,对接的是百度音乐,会自动随搜索链接百度曲库2.便捷聊天,采用xmpp基本架构.3.加入和整理了群聊天.4.分布式聊天,喜欢该专辑直接进入聊天,喜欢该音乐的进入聊天.5.采用兴趣社交和 ...

  5. Windows Server 2003 增加远程用户个数

    1.进入“开始”-“控制面板”-“添加或删除程序”如下图: 2.点击“添加/删除windows组件(A)”,进入如下图 如果该服务器没有安装“终端服务器”和“终端服务器授权”组件的话,则需要使用系统光 ...

  6. 未能加载文件或程序集“Oracle.Web, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342”或它的某一个依赖项

    当前系统环境描述: Win7x64+VS2012+IIS7 当前情况描述: 发布Web服务,在浏览的时候出现以下问题:未能加载文件或程序集“Oracle.Web, Version=2.112.1.0, ...

  7. html5面向对象做一个贪吃蛇小游戏

    canvas加面向对象方式的贪吃蛇 2016-08-25 这个小游戏可以增加对面向对象的理解,可以加强js逻辑能力,总之认真自己敲一两遍收获还是不少啊!!适合刚学canvas的同学练习!! 废话不多说 ...

  8. MongoDB 插入文档

    文档的数据结构和JSON基本一样. 所有存储在集合中的数据都是BSON格式. BSON是一种类json的一种二进制形式的存储格式,简称Binary JSON. 插入文档 MongoDB 使用 inse ...

  9. js生成有缩进的表格

    项目中用到用了两天时间想到的,记录下来,如有更好的方法,留言给我,谢谢! js做如下表格: json [{"id":302,"serviceId":15,&qu ...

  10. 重拾C,一天一点点_9-指针与数组

    这一章节很重要,一定要多思考.理解! 指针是一种保存变量地址的变量. 通常的机器 都有一系列连续编号或编址的存储单元.一个字节可存char类型,两相邻字节存储单元可存一个short,依此类推. p = ...