Skip to content

There are fixed size of known VCS, implement Representable container. #6432

Closed
@phadej

Description

@phadej

I.e. container such lookup :: RepoType -> VCS a -> a would be total.

One would need to split OtherRepoType String out of RepoType, into separate type.

There're handful of errors to be removed by this refactor.

I think this is newcomer friendly refactoring.


One example of this "issue", is e.g. miss-typing type in source-repository-package:

% cabal build      
cabal: (SourceRepo {repoKind = RepoThis, repoType = Just (OtherRepoType
"gitt"), repoLocation = Just "https://github.com/phadej/tree-diff.git",
repoModule = Nothing, repoBranch = Nothing, repoTag = Just "123", repoSubdir =
Nothing},SourceRepoRepoTypeUnsupported (OtherRepoType "gitt"))

Technically, we don't need to accept unknown RepoTypes to begin with in the cabal.project parser. Thus there's small argument from splitting RepoType into Enum part, and Either String like wrapper.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions