[Haskell-cafe] Design Question - Functions taking 'subtype' like arguments but has to be restricted to one type

Guru Devanla gurudev.devanla at gmail.com
Sat Aug 6 03:39:45 UTC 2016

On Wed, Aug 3, 2016 at 7:58 AM, MarLinn via Haskell-Cafe <
haskell-cafe at haskell.org> wrote:

> *If all carts behave the same and contents don't matter* just store
> *PlainBasket*s, i.e. a *Basket* without the annotation.

@MarLinn, Can you clarify the quoted statement.  If I were to make store
PlainBaskets in the Cart, where would be annotating the Item as
Changeble/Unchangable?  The way I understand this, you will have to pass
their phatom type all the way from the top to the innermost field where it
is required.

Would the design still hold, if we just declare Baskets of Plain types?

I appreciate your response, so far your design make sense. But, I am afraid
I am not able to extend it to higher container types.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160805/5566ce6c/attachment.html>

More information about the Haskell-Cafe mailing list