mtl-style-example 项目教程

mtl-style-example 项目教程

mtl-style-exampleA small example of using mtl style to unit test effectful code项目地址:https://gitcode.com/gh_mirrors/mt/mtl-style-example

1. 项目的目录结构及介绍

mtl-style-example/
├── package.yaml
├── README.md
├── stack.yaml
├── library/
│   └── ...
├── executables/
│   └── Main.hs
└── test-suite/
    └── Main.hs
  • package.yaml: 项目的配置文件,定义了项目的元数据、依赖和构建选项。
  • README.md: 项目的说明文档。
  • stack.yaml: 用于 Stack 构建工具的配置文件。
  • library/: 包含项目的核心代码。
  • executables/: 包含可执行文件的源代码,其中 Main.hs 是启动文件。
  • test-suite/: 包含测试代码,其中 Main.hs 是测试启动文件。

2. 项目的启动文件介绍

可执行文件启动文件

位于 executables/Main.hs,是项目的入口点,负责启动应用程序。

测试启动文件

位于 test-suite/Main.hs,是测试套件的入口点,负责运行项目的测试。

3. 项目的配置文件介绍

package.yaml

name: mtl-style-example
version: '0.0.0'
category: Other
synopsis: A small example of using mtl style to unit test effectful code
description: A small example of using mtl style to unit test effectful code
maintainer: Alexis King
extra-source-files:
- package.yaml
- README.md
- stack.yaml
ghc-options: -Wall
default-extensions:
- DefaultSignatures
- GADTs
- GeneralizedNewtypeDeriving
- LambdaCase
- OverloadedStrings
library:
  dependencies:
  - base
  - monad-logger
  - monad-time
  - mtl
  - text
  - time
  - transformers
  source-dirs: library
executables:
  mtl-style-example:
    dependencies:
    - base
    - mtl-style-example
    ghc-options:
    - -rtsopts
    - -threaded
    - -with-rtsopts=-N
    main: Main.hs
    source-dirs: executables
  • name: 项目名称。
  • version: 项目版本。
  • category: 项目分类。
  • synopsis: 项目简介。
  • description: 项目详细描述。
  • maintainer: 项目维护者。
  • extra-source-files: 额外的源文件。
  • ghc-options: GHC 编译选项。
  • default-extensions: 默认的 Haskell 语言扩展。
  • library: 库部分的依赖和源代码目录。
  • executables: 可执行文件部分的依赖、编译选项和源代码目录。

stack.yaml

resolver: lts-18.18
packages:
- .
  • resolver: 指定 Stack 使用的 LTS 版本。
  • packages: 指定包含项目的目录。

通过以上内容,您可以了解 mtl-style-example 项目的基本结构和配置。希望这份教程对您有所帮助!

mtl-style-exampleA small example of using mtl style to unit test effectful code项目地址:https://gitcode.com/gh_mirrors/mt/mtl-style-example

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

诸肖翔Loveable

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值