Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Lift the monad stack to a monad stack transformer #72

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

layus
Copy link
Contributor

@layus layus commented Nov 1, 2020

Based on top of #64. Totally unrelated, but progress is on the way :-)

Generalize types to an arbitrary monad stack for better integration into hnix.
This requires a pass across all the code. For now only the portions used by hnix have been converted.

@layus layus marked this pull request as draft November 3, 2020 22:05
@@ -210,7 +214,7 @@ buildDerivation p drv buildMode = do
-- XXX: reason for this is unknown
-- but without it protocol just hangs waiting for
-- more data. Needs investigation
putInt 0
putInt (0 :: Int)
Copy link
Member

Choose a reason for hiding this comment

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

I was keeping this one pop up in warnings intentionally as it's not clear why we need that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, good catch. this is completely unrelated.

This refactors the store to make it composable with arbitrary mtl monad
stacks, with the added constraint that `addToStore` takes a filtering
fucntion `FilePath -> PathFilter -> m Bool` which is not
MonadBaseControl compatible, and cannot be lifted (the monad is in a
negative/contravariant position).

The solution involves a RemoteStoreT transformer, a MonadRemoteStore
monad and still lacks a proper generic MonadStore which I would like to
make generic across all the store implementations (in-memeory /
read-only / remote daemon / etc.)
@sorki sorki mentioned this pull request Nov 16, 2020
6 tasks
@sorki sorki added remote `hnix-store-remote` related core `hnix-store-core` related labels Nov 28, 2023
sorki added a commit that referenced this pull request Nov 30, 2023
Co-Authored-By: Guillaume Maudoux <layus.on@gmail.com>
Co-Authored-By: John Ericson <John.Ericson@Obsidian.Systems>

Related to #72
sorki added a commit that referenced this pull request Dec 1, 2023
Co-Authored-By: Guillaume Maudoux <layus.on@gmail.com>

- `RemoteStoreT`, `RemoteStoreState` from #72

Co-Authored-By: John Ericson <John.Ericson@Obsidian.Systems>

- Reorg, `MonadRemoteStore0`, `MonadRemoteStoreHandshake`,
  `PreStoreConfig`, better `greet`

Co-Authored-By: Ryan Trinkle <ryan@trinkle.org>

- Correctly detect when other side has hung up, throws
  `RemoteStoreError_Disconnected`
sorki added a commit that referenced this pull request Dec 3, 2023
Co-Authored-By: Guillaume Maudoux <layus.on@gmail.com>

Related to #72
sorki added a commit that referenced this pull request Dec 3, 2023
- By layus
  - `RemoteStoreT`, `RemoteStoreState` from #72

- By Ericson2314
  - Reorg, `MonadRemoteStore0`, `MonadRemoteStoreHandshake`,
    `PreStoreConfig`, better `greet`

- By ryantrinkle
  - Correctly detect when other side has hung up, throws
    `RemoteStoreError_Disconnected`

Co-Authored-By: Guillaume Maudoux <layus.on@gmail.com>
Co-Authored-By: John Ericson <John.Ericson@Obsidian.Systems>
Co-Authored-By: Ryan Trinkle <ryan@trinkle.org>
sorki added a commit that referenced this pull request Dec 3, 2023
Related to #72

Co-Authored-By: Guillaume Maudoux <layus.on@gmail.com>
sorki added a commit that referenced this pull request Dec 6, 2023
- By layus
  - `RemoteStoreT`, `RemoteStoreState` from #72

- By Ericson2314
  - Reorg, `MonadRemoteStore0`, `MonadRemoteStoreHandshake`,
    `PreStoreConfig`, better `greet`

- By ryantrinkle
  - Correctly detect when other side has hung up, throws
    `RemoteStoreError_Disconnected`

Co-Authored-By: Guillaume Maudoux <layus.on@gmail.com>
Co-Authored-By: John Ericson <John.Ericson@Obsidian.Systems>
Co-Authored-By: Ryan Trinkle <ryan@trinkle.org>
sorki added a commit that referenced this pull request Dec 6, 2023
Related to #72

Co-Authored-By: Guillaume Maudoux <layus.on@gmail.com>
@sorki
Copy link
Member

sorki commented Dec 7, 2023

It is lifted now! And tagless! The thing that remains is the path filter - #271

Thanks for this, it was quite useful!

@sorki sorki mentioned this pull request Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core `hnix-store-core` related remote `hnix-store-remote` related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants