Conversation
| buildable: False | ||
| -- if (impl(ghc <9.6) || impl(ghc >=9.7)) | ||
| -- buildable: False | ||
| buildable: True |
There was a problem hiding this comment.
Temporary: proper if guard to be added later
| -- we won't accept any applications of fromString that aren't creating literals of | ||
| -- the types we support. | ||
| (strip -> GHC.Var (GHC.idDetails -> GHC.ClassOpId cls)) | ||
| (strip -> GHC.Var (GHC.idDetails -> GHC.ClassOpId cls True)) |
There was a problem hiding this comment.
True <=> given a non-bottom dictionary, the class op will
definitely return a non-bottom result
and Note [exprOkForSpeculation and type classes]
in GHC.Core.Utils
zeme-wana
left a comment
There was a problem hiding this comment.
Added comments
dc4660f to
b6eed25
Compare
zliu41
left a comment
There was a problem hiding this comment.
Do we have 9.12 in CI? It's hard to tell.
| -- we won't accept any applications of fromString that aren't creating literals of | ||
| -- the types we support. | ||
| (strip -> GHC.Var (GHC.idDetails -> GHC.ClassOpId cls)) | ||
| (strip -> GHC.Var cls) |
There was a problem hiding this comment.
What's the reason for this change?
There was a problem hiding this comment.
GHC912 changed how overloaded strings are compiled, they use fromString @_... "" which I wasn't able to match if I had it match ClassOpId.
There was a problem hiding this comment.
Then this variable should not be called "cls" anymore, since it is no longer a Class. It is now an IdDetails.
| consume li >>= traverse compileExpr | ||
| buildList _ = err | ||
|
|
||
| {- FOURMOLU_DISABLE -} -- Fourmolu can't parse non-top-level #if directives |
There was a problem hiding this comment.
Disabling fourmolu for such a large function isn't ideal. You can create a PlutusTx.Compiler.Compat module and put all the CPP there.
b05da95 to
97acd9d
Compare
zliu41
left a comment
There was a problem hiding this comment.
Looks good, just two minor comments
| -- we won't accept any applications of fromString that aren't creating literals of | ||
| -- the types we support. | ||
| (strip -> GHC.Var (GHC.idDetails -> GHC.ClassOpId cls)) | ||
| (strip -> GHC.Var cls) |
There was a problem hiding this comment.
Then this variable should not be called "cls" anymore, since it is no longer a Class. It is now an IdDetails.
| `GHC.App` _dict | ||
| `GHC.App` (strip -> content) | ||
| | GHC.getName cls == GHC.isStringClassName -> do | ||
| | GHC.getName cls == GHC.isStringClassName || GHC.getName cls == GHC.fromStringName -> do |
There was a problem hiding this comment.
cls can no longer possibly match GHC.isStringClassName since it is no longer a Class.
There was a problem hiding this comment.
You should be able to simply bind this variable on the GHC.Var itself, i.e., (strip -> var)
No description provided.