Skip to content

Add context parameter to *Table types#101

Merged
shane-circuithub merged 2 commits intomasterfrom
tag-refactor
Jul 5, 2021
Merged

Add context parameter to *Table types#101
shane-circuithub merged 2 commits intomasterfrom
tag-refactor

Conversation

@shane-circuithub
Copy link
Copy Markdown
Contributor

This allows to get rid of all the Tag nonsense and to further simplify the Nullifiable nonsense.

Arguably we should have done it like this in the first place, as it brings a lot of nonsense that was hiding inside Tag out into the open.

It was nice to not have an extra redundant-seeming type parameter (because the a already has a Context), but it isn't actually redundant. The proposed solution to the Projection problem will need this extra context parameter and there are no tricks with Tag we can do to get around that.

This allows to get rid of all the `Tag` nonsense and to further simplify the `Nullifiable` nonsense.

Arguably we should have done it like this in the first place, as it brings a lot of nonsense that was hiding inside `Tag` out into the open.

It was nice to not have an extra redundant-seeming type parameter (because the `a` already has a `Context`), but it isn't actually redundant.

The proposed solution to the `Projection` problem will definitely need this extra `context` parameter and there are no tricks with `Tag` we can do to get around that.
@shane-circuithub shane-circuithub requested a review from ocharles July 3, 2021 01:55
{-# language MultiParamTypeClasses #-}
{-# language StandaloneKindSignatures #-}
{-# language TypeFamilies #-}
{-# language TypeFamilyDependencies #-}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you either forgot to use this - line 41 has no dependency

Copy link
Copy Markdown
Contributor

@ocharles ocharles left a comment

Choose a reason for hiding this comment

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

It was great we got so far without this, but as we've both found now - there's a ton of value to be derived from having this in the type. So while it's a bit of a shame, I'm on board with this.

@ocharles ocharles changed the title Add context parameter to {Either,Maybe,These}Table Add context parameter to *Table types Jul 3, 2021
@ocharles
Copy link
Copy Markdown
Contributor

ocharles commented Jul 3, 2021

I dunno if you wanna confirm this actually unblocks the Projection stuff first, or maybe you've already checked that. Just thinking of avoiding an incomplete solution, but of course we could always revert if needed

In this case, the extra `Context` parameter is actually 100% redundant as things stand, but it opens up the possibility of a `Prelude.Functor` instance for for `ListTable` further down the line, and at least remains "consistent" with the other `*Table` types.
@shane-circuithub shane-circuithub merged commit 707a36a into master Jul 5, 2021
@shane-circuithub shane-circuithub deleted the tag-refactor branch July 5, 2021 01:25
ocharles added a commit that referenced this pull request Jul 6, 2021
ocharles added a commit that referenced this pull request Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants