haskell / haskell/cabal

Reader Monad for Flags

Open
#4,492 8 comments 3 reactions 0 assignees View on GitHub
re: monad type: refactor
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

cabal is designed mostly without the use of monads. This leads to functions passing context via arguments along. And even so explicitly.

It seems like there is some interest in having cabal be partially refactored to use a Reader Monad for Flags (global, command specific, and **verbosity**).

I believe carrying a Record along as `context` instead of passing arguments explicitly might improve the situation, however a Monadic approach would even free one of having to pass the context explicitly.

The questions that remains are:
- 👍 or 👎
- How should the monad stack look? (I'd prefer not to hand roll it)
- What monad libraries can we use for convenience? (boot library restrictions)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.