"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. html5 图片转base64预览显示

    <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title> ...

  2. HTTP长连接200万尝试及调优

    对于一个server,我们一般考虑他所能支撑的qps,但有那么一种应用, 我们需要关注的是它能支撑的连接数个数,而并非qps,当然qps也是我们需要考虑的性能点之一.这种应用常见于消息推送系统,也称为 ...

  3. java的WebService实践(cxf)

    Java发布WebService,结合Spring,通过cxf的方式 难点:1.引用什么jar包: 1.创建接口 源码如下: package com.nankang; import javax.jws ...

  4. Linux系统在嵌入式硬件上的移植

    =========================        基本常识       ========================= 一. Linux系统的基本构成: 1. loader 2.  ...

  5. C++ 必知必会:条款15 成员的指针并非指针

    指向类成员的类成员的指针说是“指针”,其实是不合适的,因为他既不包含地址,其行为也不像指针 常规的指正,包含地址,对其解应用可以得到该指针包含地址所指向的对象 1: int a = 12: 2: in ...

  6. 搭建高性能计算环境(八)、应用软件的安装之gromacs

    1,下载安装新版本的gcc(高版本的gcc只是推荐使用的,系统自带的gcc4.4照样能正常编译.运行) wget http://ftp.tsukuba.wide.ad.jp/software/gcc/ ...

  7. UML类图常见关系总结

    Unified Modeling Language (UML)又称统一建模语言或标准建模语言. 在UML类图中,常见的有以下几种关系: 泛化(Generalization),  实现(Realizat ...

  8. 使用C#中JavaScriptSerializer类将对象转换为Json格式数据

    将对象转换为json格式字符串: private JavaScriptSerializer serializer = new JavaScriptSerializer(); protected voi ...

  9. [Java]_函数传参的疑惑与思考

    问题来源于leetcode上的两道题 Path Sum I && II,分别写了两个dfs. void dfs(TreeNode node , int sum , ArrayList& ...

  10. [leetcode]_Path Sum I && II

    都是考查DFS.经典回溯算法,问题在于我对该类型的代码不熟悉,目前以参考别人的代码,然后加上自己的实现为主,通过类似的题目加强理解. 一.给定一棵二叉树,判断是否存在从root到leaf的路径和等于给 ...