I get an error I don't know why b and the constraint (Set b, Set s) are being matched? I would expect the constraint to existentially quantify the ...
I get an error I don't know why b and the constraint (Set b, Set s) are being matched? I would expect the constraint to existentially quantify the ...
Recently, I came up with the idea that one could potentially emulate "intersection types" in Haskell. Specifically, I mean intersection of "interfaces ...
I would like to express a Constraint on types of kind k -> k -> Type, which can be stated in English as: A type s such that, forall x x', y, ...
Is it possible to write a type function that would take a constraint like Show and return one that constrains the RHS to types that are not an instanc ...
Hypothesis: Type families which result in Constraints are always distributive over their representational parameters. As an example, Fam x Eq `And` F ...
I want to have an empty constraint at a higher kind. Suppose I have the following class: Now I want to make an instance for functions such that it ...
The following snippet makes GHC (checked with 8.6.2 & 8.4.4) stuck during compilation: I think that it gets stuck because for t GHC tries to fi ...
I'm getting an unexpected error when trying to compile a small Haskell file with GHC 8.6.1 when using ConstraintKinds and TypeSynonymInstances. I'd l ...
how can one represent the empty constraint ? for the following file ghc 8.2.2 answers what do i miss ? i know about the following solution ...
I understand the following type family shouldn't and perhaps can't be implemented in GHC: This is problematic because classes are open, so MatchesC ...
The following snippet of code borrows from the Haskell wiki to carry around a typeclass dictionary along with an existential type: Is it possible t ...
I searched Hackage and couldn't find anything like the following but it seems to be fairly simple and useful. Is there a library that contains sort of ...
I can write the following: And all is good. Presumably GHC can derive Integral from Num so all is well. I can be a bit tricker, yet I'm still fine ...
I've been playing with some GHC extensions to define a function that can do the following: myFunc should be fully polymorphic in the signature of s ...
What is a Constraint kind? Why would someone use it (in practice)? What is it good for? Could you give a simple code example to illustrate the an ...
I'm not familiar with GHC internals but I have a couple questions about ConstraintKinds. It says from GHC.Exts that which is misleading because Co ...
If I inspect the kind of Maybe I get this: Now, if I inspect the kind of Monad I get this: What is Constraint there and why it is needed ? Why n ...
Apparently a bit absent-mindedly, I wrote something like the following: Only after successfully compiling, I realised this shouldn't actually work: ...
I have this code snippet which uses a plethora of GHC extensions: GHC complains that: Why can't I promote HList to a kind? I get the same error ...
I have a class C with instances for one type and for tuples. Using the normal Dict GADT for capturing constraints is it possible to prove C a fr ...