Skip to content

Allow functor derivation under quantification#3295

Merged
LiamGoodacre merged 2 commits into
purescript:masterfrom
i-am-tom:master
Apr 10, 2018
Merged

Allow functor derivation under quantification#3295
LiamGoodacre merged 2 commits into
purescript:masterfrom
i-am-tom:master

Conversation

@i-am-tom

@i-am-tom i-am-tom commented Mar 29, 2018

Copy link
Copy Markdown

When "functor variables" exist within a quantifier, they don't seem to
derive properly:

data T a = T (forall x. a)

This commit (hopefully!) fixes this, allowing the compiler to drill down
through these skolem scopes. This fixes #3232.

When "functor variables" exist within a quantifier, they don't seem to
derive properly:

```
data T a = T (forall x. a)
```

This commit (hopefully!) fixes this, allowing the compiler to drill down
through these skolem scopes.
@i-am-tom

Copy link
Copy Markdown
Author

Have spoken to @LiamGoodacre, there are a couple more things to do before this is ready for review 😳

@i-am-tom

Copy link
Copy Markdown
Author

Also now does constraints!

- One can now derive functors for types that involve constraints.
- Shadowed variables are now properly handled in functor deriving.

tl;dr: this works now!

```
data T a = T (forall x. Show x => a) (forall a. a)
```

@LiamGoodacre LiamGoodacre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LiamGoodacre LiamGoodacre merged commit f88caab into purescript:master Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Functor deriving should support quantified arguments of a constructor

2 participants