Closed utdemir closed 3 years ago
@utdemir The current behaviour that relies on simple lists is indeed suboptimal. A proper fix would be to use a type-level set, as proposed in #4.
Your solution with changing the definition of <>
would also work, but I'm afraid it will be very slow at compile time.
Thanks, I didn't see that issue. Looking forward to the solution!
Thanks for the package, the interface looks great!
I have a quick question. When looking at the source code, I noticed that
bind
simply concatenates without checking for duplicates, as can be seen from the below code (based on your example):This was unexpected for me initially, I would expect the type to be
EIO '[MyErr] ()
in that case. I guess the likely argument is thatcatch
deletes all occurences, so removing the duplicates are not necessary. Is this the case?As an alternative, I tried a simple (but inefficient) change:
I think this increases readability a bit, since now we can write things like:
With the current type,
baz
's type would beEIO '[MyErr1, MyErr2, MyErr2, MyErr1] ()
, which is a mouthful.What do you think?