brandonchinn178 / brandonchinn178/toml-reader

Add more Decoder helpers

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
Haskell
Stars
16
Forks
8
PR merge metrics
No merged PRs in 30d

Description

```hs
toDecoder :: DecodeM a -> Decoder a
toDecoder m = makeDecoder (const m)

applyDecoder :: Decoder a -> Value -> Decoder a
applyDecoder decoder = toDecoder . runDecoder decoder

-- Type mismatch: Expected String, got:
typeMismatch :: Text -> Decoder a
typeMismatch' :: Text -> Value -> DecodeM a

-- Invalid value: , got:
invalidValue :: Text -> Decoder a
invalidValue' :: Text -> Value -> DecodeM a
```
hide `DecodeM` functions; recommend `invalidValue` or `typeMismatch` over `fail`

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the Decoder, DecodeM, and Value definitions, then inspect the existing fail-based decoding paths and public exports. Confirm how the proposed helpers should construct type-mismatch and invalid-value errors, hide DecodeM functions from the public API, and verify that callers can use invalidValue or typeMismatch instead of fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.