Skip to content

Refactor module MediaType.hs to use Network.HTTP.Media #2901

Closed
@taimoorzaeem

Description

@taimoorzaeem

Description of issue

The MediaType.hs module is quite verbose and the code looks kind of ugly. For instance:

instance Eq MediaType where
MTApplicationJSON == MTApplicationJSON = True
MTArrayJSONStrip == MTArrayJSONStrip = True
MTSingularJSON x == MTSingularJSON y = x == y
MTGeoJSON == MTGeoJSON = True
MTTextCSV == MTTextCSV = True
MTTextPlain == MTTextPlain = True
MTTextXML == MTTextXML = True
MTOpenAPI == MTOpenAPI = True
MTUrlEncoded == MTUrlEncoded = True
MTOctetStream == MTOctetStream = True
MTAny == MTAny = True
MTOther x == MTOther y = x == y
MTPlan{} == MTPlan{} = True
_ == _ = False

Solution

The module could be refactored to use Network.HTTP.Media. This would let us remove the above mentioned part.

Metadata

Metadata

Assignees

No one assigned

    Labels

    hygienecleanup or refactoring

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions