why does haskell not allow two data constructors to share const and other defined data attributes?

Haskell doesn’t allow this because it would be ambiguous. The value constructor Prop is effectively a function, which may be clearer if you ask GHCi about its type:

> :t Const
Const :: Bool -> Prop

If you attempt to add one more Const constructor in the same module, you’d have two ‘functions’ called Const in the same module. You can’t have that.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top