Skip to content

Remove redundant DotProtoNoPackage constructor in DotProtoPackageSpec#293

Open
riz0id wants to merge 1 commit intomasterfrom
riz0id/refact-package-spec
Open

Remove redundant DotProtoNoPackage constructor in DotProtoPackageSpec#293
riz0id wants to merge 1 commit intomasterfrom
riz0id/refact-package-spec

Conversation

@riz0id
Copy link
Collaborator

@riz0id riz0id commented Oct 31, 2025

DotProtoPackageSpec previously was equivalent to Maybe DotProtoIdentifier using the case where Nothing :: Maybe DotProtoIdentifier to denote a protobuf file without a package statement declaring the name of the package. This updates the definition of the DotProtoPackageSpec so that it only wraps the DotProtoIdentifier type:

newtype DotProtoPackageSpec = DotProtoPackageSpec 
  { getDotProtoPackageSpec :: DotProtoIdentifier }

This change removes the DotProtoNoPackage constructor and instead relies on the Anonymous constructor in DotProtoIdentifier to represent the case where no package is declared.

@riz0id riz0id requested a review from j6carey October 31, 2025 12:38
@riz0id riz0id self-assigned this Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant