GithubHelp home page GithubHelp logo

funnyhaskell's Introduction

funnyHaskell

Haskell趣学指南是一本非常有趣的书,虽然现在非常忙,但我希望在接下来的一段时间里能集中学习完这本书,这个项目也算是对github的一次练习,包含每个章节的笔记和练习

这本书虽然有免费的在线版,但是我希望通过这种复述的笨办法来学习haskell,到了年底看看这个懒毛病会不会复发。

在学习完一章之后进行向主分支的merge

第一章 各就各位,预备!

准备工具

编辑器(vscode)和编译器(glasgow haskell compiler GHC)

最简单的方法是下载Haskell Platform,包含很多有用的库

在终端中使用ghci来进入交互模式

学习流程: 在一个文件中定义了几个函数,通过:l myfuctions将函数装载进GHCi(需要保证脚本位于启动GHCi的同一目录下) 在修改了这个脚本内容之后,可以再次通过:l myfunctions或等价的:r来重新装载脚本

1.1 调用函数

1.2 小朋友的第一个函数

1.3 列表入门

  1. 拼接列表
  2. 访问列表中的元素
  3. 嵌套列表
  4. 比较列表
  5. 更多列表操作

1.4 得州区间

1.5 我是列表推导式

1.6 元组

  1. 使用元组
  2. 使用序对
  3. 找直角三角形

相信类型

2.1 显式类型声明

2.2 Haskell的常见类型

2.3 类型变量

2.4 类型类入门

  1. Eq类型类
  2. Ord类型类
  3. Show类型类
  4. Read类型类
  5. Enum类型类
  6. Bounded类型类
  7. Num类型类
  8. Floating类型类
  9. Integeral类型类
  10. 有关类型类的最后总结

函数的语法

3.1 模式匹配

  1. 元组的模式匹配
  2. 列表与列表推导式的模式匹配
  3. As模式

3.2 注意,哨卫!

3.3 where ? !

  1. where的作用域
  2. where中的模式匹配
  3. where块中的函数

3.4 let

  1. 列表推导式中的let
  2. GHCi中的let

3.5 case表达式

你好,递归

4.1 不可思议的最大值

4.2 更多的几个递归函数

  1. replicate
  2. take
  3. reverse
  4. repeat
  5. zip
  6. elem

4.3 快点,排序!

  1. 算法思路
  2. 编写代码

4.4 递归地思考

高阶函数

5.1 柯里函数

  1. 截断
  2. 打印函数

5.2 再来点儿高阶函数

  1. 实现zipWith
  2. 实现flip

5.3 函数式程序员工具箱

  1. map函数
  2. filter函数
  3. 有关mapfilter的更多示例
  4. 映射带有多个参数的函数

5.4 lambda

5.5 折叠纸鹤

  1. 通过foldl进行左折叠
  2. 通过foldr进行右折叠
  3. foldll函数与foldrl函数
  4. 折叠的几个例子
  5. 另一个角度看折叠
  6. 无限列表的折叠
  7. 扫描

5.6 有$的函数应用

5.7 函数组合

  1. 带有多个参数函数的组合
  2. Point-Free风格

funnyhaskell's People

Contributors

leemingx avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.