Closed lspitzner closed 4 years ago
Very nice, thanks!
Hmmm, it seems CI is not (always?) being ran on PRs. Need to check why is that :disappointed:
Anyway, stack test
is failing atm, so we need to give that a look
Ah, sorry about that.
The problem is that it can't resolve the Wear
TF if the last argument is not known. With
data ParXW a t f = ParXW (Wear t f a)
a
could be Thin g x
or it could be something else. And the instances (all of them I think) would look different depending on that.
Could add a NoThin
marker just to fix this case?
data ParXW a t f = ParXW (Wear t f (NoThin a))
type family Wear t f a where
Wear Bare f (NoThin a) = a
Wear Bare f (Thin g a) = a
Wear Bare f a = a
Wear Covered f (NoThin a) = f a
Wear Covered f (Thin g a) = f (g a)
Wear Covered f a = f a
Wear (Param _ t) f a = Wear t f a
Wear t _ _ = TypeError …
I can understand if you want to revert and consider the options.
While something like NoThin
could work, it would make it a backwards incompatible change, which I'd like to avoid. We may still find a variation of this idea that works, but in the meantime I reverted the commit, sorry!
As discussed in #28.
I haven't tested this fully yet but the following example seems to work fine so far. It depends on an unreleased (and entirely unpublished) feature of the
butcher
library and does not make use of theSemigroup
fields, but it is a good first test:The flagParser is a barbie covered in a parser applicative (butcher's CmdParser). Fancy stuff :)