> On May 18, 2017, at 5:27 PM, Simon Peyton Jones wrote:
>
> I don't agree. If you call (tcSubsumes hole_ty ty) with closed types
> hole_ty, ty, it should return True if
I agree here. But it looks like Matthías's function gets the expected type as
pushed down by
Hi Tom,
The problem is that GHC lazily loads non-orphan instances, so they won't
be in the environment until you load the interface which would have
caused the instance to come into scope.
I'm not sure exactly what you are actually trying to do. But if you
really need all instances, you will
| This is going to be challenging to fix, I'm afraid.
I don't agree. If you call (tcSubsumes hole_ty ty) with closed types
hole_ty, ty, it should return True if
ty is more polymorphic than hole_ty.
For example
tcSubsumes (forall a. [a] -> [a])
(forall b. b -> b)
should
Dear GHC Devs.
I am trying to use the GHC API as part of the work that I am doing for
my thesis. Currently I am looking for a way to find all the type class
instances that are in scope in a given module.
Here's what I've tried:
```
getInstancesFromTcmodule
:: GhcMonad m
=>
Hi Matthías,
This is going to be challenging to fix, I'm afraid.
When GHC sees a definition with a polymorphic type signature, it *skolemizes*
the signature before ever looking at the definition. In this context,
skolemizing means that GHC will fix the type variable a (in your trace, it
Greetings,
I'm working on improving the valid substitution feature that I implemented
a few weeks ago, but I'm having a problem making it work with subsumption,
i.e. if the types are not exactly equal. You can find all the code on a
branch on my fork of GHC on GitHub
Yes that looks right. A class instance can’t dispatch on a type family
application. In haskell we don’t allow
reverse (a ++ b) = reverse a ++ reverse b
and it’s the same for type families and class instances. You should do the
type-family reduction yourself, as you do below.
Simon
From:
And to answer my own question, it seems
instance HasSourceText SourceText where
noSourceText= NoSourceText
sourceText s= SourceText s
getSourceText a = a
And then applying the appropriate constraint at the use-site does the job.
So
noSyntaxExpr :: (HasSourceText (XHsString
Hi all
I am experimenting with Trees that Grow [1] in the context of the GHC HsSyn
AST, and wanting to express that a given extension point needs to have
certain properties.
The specific case is to be able to contain a SourceText, in the context of
HsLit
So I have (stripped down)
data GHCX