Add support for more flexible backend streams
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- haskell
- Domain
- networking
Research direction
Start by reviewing HaskellNet's IMAP stream handling and the BSStreamM approach in the linked monadio branch. Compare that with the proposed conduit-based connection model and determine which direction has consensus. Done means a scoped, agreed design for flexible backend streams rather than an unresolved choice between alternatives.
Written by the indexing model from the issue text.
Description
I wanted to use IMAP with TLS and this turned out to be quite complex. (Relates to #7.) So far, I found these solutions:
-
Use threads - one for wrapping a connection into TLS and another for the actual IMAP handling. This is awful.
-
Use
MonadIOinstead ofIOeverywhere. I already tried this variant in this branch for IMAP. It seems to work well and I was able to fuse such patched IMAP with network-conduit. The main part looks like this:main = runTCPClient (clientSettings 143 (BS.pack "imap.centrum.cz")) capabilities capabilities :: Application IO capabilities ad = appSource ad $= f $$ appSink ad where f :: Conduit BS.ByteString IO ByteString f = do c <- connectStream conduitBSStream capability c >>= liftIO . print logout c type BSPipe m = ConduitM ByteString ByteString m conduitBSStream :: (Monad m) => BSStreamM (BSPipe m) -- implementation ...Here
BSStreamMis a (backward compatible) modification that takes an arbitraryMonadIOinstead ofIO. This allows us to run the whole code inConduitinstead ofIOand so the actions inBSStreamMcan be operations constructed usingConduitprimitives. (Full example code here).This modification adds generality and the only loss is slightly more complex type signatures.
-
Modify HaskellNet so that it's based on conduit instead of
IO. I don't have a clear picture yet. The general idea is that connection wouldn't hold aBSStreambut aSinkfor network output and aResumableSourcefor network input. This would allow to plug in any conduit, even a pure one (for testing, for example).
I'm willing to participate on those changes, if we reach some consensus.
- Dominant language
- Haskell
- Stars
- 92
- Forks
- 57
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from qnikst/HaskellNet
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
qnikst/HaskellNet#107 · 1 comment ·
-
feature
Difficulty 5/5 Over a week Newbie friendliness 25/100
qnikst/HaskellNet#84 ·
-
feature
Difficulty 5/5 Over a week Newbie friendliness 25/100
qnikst/HaskellNet#80 ·
-
feature help needed
Difficulty 5/5 Over a week Newbie friendliness 35/100
qnikst/HaskellNet#77 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
qnikst/HaskellNet#68 ·
All issues in qnikst/HaskellNet
Similar issues
-
time-manager-0.4.0 Openfailure: bounds
Difficulty 1/5 Under an hour Newbie friendliness 72/100
commercialhaskell/stackage#8122 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
simplex-chat/simplex-chat#7547 ·
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 90/100
alunduil/alunduil-chezmoi#775 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
objectionary/phino#1350 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100