Introduction to Haskell
"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的更多相关文章
- 初识Haskell 五:自定义数据类型和类型类
对Discrete Mathematics Using a Computer的第一章Introduction to Haskell进行总结.环境Windows 自定义数据类型 data type de ...
- 初识Haskell 四:函数function之二 常见函数
对Discrete Mathematics Using a Computer的第一章Introduction to Haskell进行总结.环境Windows,关于函数的部分太长了,分开写. 常用的对 ...
- 初识Haskell 三:函数function
对Discrete Mathematics Using a Computer的第一章Introduction to Haskell进行总结.环境Windows 函数毫无疑问是函数式语言的核心. 在Ha ...
- 初识Haskell 二:基本操作符、类型Type、数据结构
对Discrete Mathematics Using a Computer的第一章Introduction to Haskell进行总结.环境Windows 1. 在安装了ghci后,便可以进行Ha ...
- (转)Awesome Courses
Awesome Courses Introduction There is a lot of hidden treasure lying within university pages scatte ...
- Github上的1000多本免费电子书重磅来袭!
Github上的1000多本免费电子书重磅来袭! 以前 StackOverFlow 也给出了一个免费电子书列表,现在在Github上可以看到时刻保持更新的列表了. 瞥一眼下面的书籍分类目录,你就能 ...
- Github 的一个免费编程书籍列表
Index Ada Agda Alef Android APL Arduino ASP.NET MVC Assembly Language Non-X86 AutoHotkey Autotools A ...
- Haskell 参考资料
1.Haskell 中文社区:www.haskellcn.org 2.Haskell 官网: www.haskell.org 3.Haskell 函数查询:www.haskell.or ...
- [2017.02.21] 《Haskell趣学指南 —— Learning You a Haskell for Great Good!》
{- 2017.02.21 <Haskell趣学指南 -- Learning You a Haskell for Great Good!> [官网](http://learnyouahas ...
随机推荐
- leetcode 118
118. Pascal's Triangle Given numRows, generate the first numRows of Pascal's triangle. For example, ...
- HttpClient入门
HttpClient入门 HttpClient 是 Apache Jakarta Common 下的子项目,可以用来提供高效的.最新的.功能丰富的支持 HTTP 协议的客户端编程工具包,并且它支持 H ...
- SqlServer 事务和异常处理示例
BEGIN TRANSACTION--开始事务 DECLARE @errorSun INT --定义错误计数器SET @errorSun=0 --没错为0 UPDATE dbo.Test SET te ...
- repeater标签双重循环的使用
在网站开发中,.NET中的repeater标签几乎是笔者首选,也是唯一一个不会生成多余元素的标签,所有样式都是自定义的,这点类似 struts中的<s:iterator/>标签. 在日常编 ...
- CICS中设置程序常驻内存
CICS中设置程序常驻内存 Permanent=no 修改为Permanent=yse --------------------- 对CICS的参数进行调节,RD中
- 转载:T-SQL语句大全
一.基础 1.创建数据库 CREATE DATABASE database-name 2.删除数据库 drop database dbname 3.备份数据库 --- 创建 备份数据的 device ...
- (转)浅谈HTML5与css3画饼图!
神马系饼图? 饼图,大家都应该熟知,在统计数据对比方面,几乎处处用到.如cnzz的统计饼图 从饼图中,很形象地展示了访问者地区的分布,以扇形为块的方式拼成一个大圆. 都使用什么方法实现 目前众多站点制 ...
- PHP加密解密函数
<?php/***功能:对字符串进行加密处理*参数一:需要加密的内容*参数二:密钥*/function passport_encrypt($str,$key){ //加密函数 srand((do ...
- 十天学会单片机Day3 D/A与A/D转换器
D/A转换器 1.二进制权电阻网络型D/A转换器 基准电压Vref 数据D(d3d2d1d0) 输出模拟电压V0 i0 = Vref/8R i1 = Vref/4R i2 = Vref/ ...
- Python核心编程--学习笔记--6--序列(上)字符串
本章研究Python中的序列:字符串.列表和元组.因为这些类型其实都是由一些成员共同组成的一个序列整体,所以我们把它们统称为序列.序列的存储结构可以表示为: 1 序列 序列类型有着相同的访问模式:按下 ...