RE: Find constraints over type

2020-01-17 Thread Simon Peyton Jones via ghc-devs
: abs_ev_vars binds dictionaries from let-bindings Simon From: Alejandro Serrano Mena Sent: 17 January 2020 08:26 To: Simon Peyton Jones Cc: GHC developers Subject: Re: Find constraints over type My goal is to add type information on hover within `ghcide`. Right now, when you select a variable, we give

Re: Find constraints over type

2020-01-17 Thread Alejandro Serrano Mena
My goal is to add type information on hover within `ghcide`. Right now, when you select a variable, we give back the type as reported in the corresponding Var. However, when this type involved a type variable, it misses a lot of important information about the typing context in which we are

RE: Find constraints over type

2020-01-16 Thread Simon Peyton Jones via ghc-devs
There is definitely no pure way to get from ‘a’ to its constraints. * It is far from clear what “its constraints” are. Is (C a b) such a constraint? C [a] b? What about superclasses? * Constraints vary depending on where you are. GADT matches can bring into scope extra constraints

Re: Find constraints over type

2020-01-16 Thread Ben Gamari
Alejandro Serrano Mena writes: > Dear GHC devs, > I am trying to figure out a way to obtain the constraints that hold over a > type. Let me give you an example: suppose that I write the following > function: > > f :: Eq a => [a] -> Bool > f xs = xs == [] > > If I ask for the type of the Var '