Git Product home page Git Product logo

magic-haskell's Introduction

魔力Haskell官方网站

欢迎来到《魔力Haskell》的官方网站,这里提供书中的样章范例。此外还有本人正在录制的一套Haskell系列教程配套slide

另外有幸执教了2019年清华大学上半学年的Haskell编程课程,课件和视频在这里

用cabal运行

运行范例需要电脑上提前安装cabal-installghc,你可以从这里获得它们,之后只需要:

git clone https://github.com/winterland1989/magic-haskell.git
cd ./magic-haskell/code
cabal sandbox init
cabal install --only-dependencies
cabal build

即可编译,执行如下命令运行范例:

# 第6章 常用的列表操作 最小子串和问题
cabal run -- min-sub-list

# 第12章 透镜组
cabal run -- lens

# 第15章 解析器
cabal run -- arg-parser

# 第17章 八皇后问题和列表单子
cabal run -- queens

# 第18章 Reader单子
cabal run -- reader-render

# 第19章 State单子
cabal run -- state-calculator

# 第24章 单子变换 猜数字游戏
cabal run -- guess-number

# 第25章 单子变换的升格操作
cabal run -- calculator

# 第28章 数据库操作
cabal run -- database

# 第29章 模版编程 (相关代码: Template.hs, MakeLenses.hs)
cabal run -- template

# 第31章 高级类型编程 异类列表
cabal run -- hlist

用stack运行

stackcabal sandbox类似,也是创建一个独立的环境。 安装见 https://docs.haskellstack.org/en/stable/README/

cd code && stack build

# 第6章 常用的列表操作 最小子串和问题
stack MinSubList.hs

...

另外对于本书有任何建议,请直接在本项目上提交issue,我会尽快回复并记录。感谢各位读者的支持,希望这本书能在大家学习、工作的路上有所帮助。

magic-haskell's People

Contributors

winterland1989 avatar wangwangwar 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.