Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #530 Introduce HpackError type, for Hpack errors #531

Closed
wants to merge 1 commit into from

Commits on Nov 26, 2022

  1. Fix sol#530 Introduce HpackError type, for Hpack errors

    The `HpackError` type is an instance of `Eq`. Consequently, its data constructors involve only values of types that are instances of `Eq`.
    
    The `renderHpackError :: ProgramName -> HpackError -> String` function preserves the existing error messages of all existing Hpack errors.
    
    Moves `ProgramName` from `Hpack.Config` to new module `Hpack.Error` because `renderHpackError` makes use of the type.
    
    Defines, and applies, `hpackProgName :: ProgramName`, for convenience.
    
    The `DecodeOptions` constructor no longer needs its `decodeOptionsProgramName :: ProgramName` field (and `setProgramName` falls away). Its `decodeOptionsDecode` field is of type `FilePath -> IO (Either HpackError ([String], [Value]))`.
    
    The module "Hpack" exports new function `hpackResultWithError :: Options -> IO (Either HpackError Result)`.
    
    Updates tests accordingly. Some tests use `shouldSatisfy` rather than `shouldReturn`.
    
    Also bumps Hpack's `stack.yaml` to use lts-20.1 (GHC 9.2.5) rather than lts-15.11 (GHC 8.8.3).
    mpilgrem committed Nov 26, 2022
    Configuration menu
    Copy the full SHA
    4fb87c6 View commit details
    Browse the repository at this point in the history