is there any way to use the custom type error machinery to override the default "no instance for X arising from use of Y"? i'm admittedly pretty new to type-level programming
wow, yes, thanks. exactly like that. i'd seen that bit of documentation but i guess it didn't click since i'm playing with an empty type class; didn't occur to me that I could just drop the where. also ended up needing to tinker with OverlappingInstances.
tangentially related question, is it possible to write a type family which, given a typeclass and a list of types, produces a constraint which holds if any one of the types is a member of the class? I have something like the Member construct from polysemy in mind, but i'm not sure exactly how to port that over to my use case
The very nature of type classes is that anyone could declare an instance anywhere, so it's not possible to tell that an instance definitely does not exist.
is there any way to use the custom type error machinery to override the default "no instance for X arising from use of Y"? i'm admittedly pretty new to type-level programming
You mean like this? https://hackage.haskell.org/package/base-4.12.0.0/docs/GHC-TypeLits.html#t:TypeError
wow, yes, thanks. exactly like that. i'd seen that bit of documentation but i guess it didn't click since i'm playing with an empty type class; didn't occur to me that I could just drop the
where
. also ended up needing to tinker with OverlappingInstances.tangentially related question, is it possible to write a type family which, given a typeclass and a list of types, produces a constraint which holds if any one of the types is a member of the class? I have something like the
Member
construct from polysemy in mind, but i'm not sure exactly how to port that over to my use casei've gotten this far but have no idea what
??
should be or if a fitting expression is even possibleNo it's not possible.
The very nature of type classes is that anyone could declare an instance anywhere, so it's not possible to tell that an instance definitely does not exist.
Gotcha, thanks. Won't waste any more time scratching my head on this one then