开源项目 extensible-effects 使用教程

开源项目 extensible-effects 使用教程

extensible-effectsExtensible Effects: An Alternative to Monad Transformers项目地址:https://gitcode.com/gh_mirrors/ex/extensible-effects

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




extensible-effects/


├── CHANGELOG.md


├── LICENSE


├── README.md


├── Setup.hs


├── app/


│   └── Main.hs


├── src/


│   ├── Control/


│   │   └── Extensible/


│   │       └── Effect/


│   │           ├── Class.hs


│   │           ├── Internal.hs


│   │           ├── Invocation.hs


│   │           ├── Member.hs


│   │           ├── Poly.hs


│   │           ├── Reader.hs


│   │           ├── State.hs


│   │           ├── Writer.hs


│   │           └── ...


│   ├── Data/


│   │   └── Extensible/


│   │       └── Effect/


│   │           ├── Algebra.hs


│   │           ├── Carrier.hs


│   │           ├── Effect.hs


│   │           ├── Handler.hs


│   │           ├── OpenUnion.hs


│   │           └── ...


│   └── ...


├── test/


│   └── Spec.hs


└── extensible-effects.cabal

CHANGELOG.md: 记录项目的更新日志。LICENSE: 项目的许可证信息。README.md: 项目的介绍和使用说明。Setup.hs: 用于项目构建的设置文件。app/: 包含项目的启动文件。src/: 包含项目的主要源代码。test/: 包含项目的测试代码。extensible-effects.cabal: 项目的配置文件。

2. 项目的启动文件介绍

项目的启动文件位于 app/Main.hs,该文件通常包含程序的入口点,负责初始化和启动整个应用程序。




module Main where


 


import Control.Extensible.Effect


import Control.Extensible.Effect.Default


 


main :: IO ()


main = do


    putStrLn "Starting extensible-effects application..."


    -- 在这里添加你的初始化代码和主逻辑

3. 项目的配置文件介绍

项目的配置文件是 extensible-effects.cabal,该文件包含了项目的元数据、依赖关系、构建选项等信息。




name:                extensible-effects


version:             1.0.0


synopsis:            Extensible effects library


description:         A library for handling extensible effects in Haskell.


homepage:            https://github.com/suhailshergill/extensible-effects


license:             MIT


author:              Suhail Shergill


maintainer:          suhail@shergill.io


category:            Control


build-type:          Simple


cabal-version:       >=1.10


 


library


  exposed-modules:


    Control.Extensible.Effect


    Control.Extensible.Effect.Default


    Data.Extensible.Effect


    Data.Extensible.Effect.Algebra


    Data.Extensible.Effect.Carrier


    Data.Extensible.Effect.Effect


    Data.Extensible.Effect.Handler


    Data.Extensible.Effect.OpenUnion


  other-modules:


    Paths_extensible_effects


  build-depends:


    base >=4.12 && <4.13,


    transformers >=0.5 && <0.6


  hs-source-dirs:      src


  default-language:    Haskell2010


 


executable extensible-effects


  main-is:             Main.hs


  other-modules:


    Paths_extensible_effects


  build-depends:


    base >=4.12 && <4.13,


    extensible-effects


  hs-source-dirs:      app


  default-language:    Haskell2010


 


test-suite extensible-effects-test


  type:                exitcode-stdio-1.0


  main-is:             Spec.hs


  other-modules:


    Paths_extensible_effects


  build-depends:


    base >=4.12 && <4.13,


    extensible-effects,


    hspec >=2.7 && <2.8


  hs-source-dirs:      test


  default-language:    Haskell2010

该配置文件定义了库、可执行文件和测试套件的构建信息,包括依赖关系、

extensible-effectsExtensible Effects: An Alternative to Monad Transformers项目地址:https://gitcode.com/gh_mirrors/ex/extensible-effects

© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...