forked from haskell-nix/hnix-store
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request haskell-nix#279 from squalus/narfrompath
remote: add NarFromPath client
- Loading branch information
Showing
11 changed files
with
151 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module DataSink | ||
|
||
( DataSink(..) | ||
, dataSinkResult | ||
, dataSinkWriter | ||
, newDataSink | ||
) | ||
|
||
where | ||
|
||
import Data.ByteString (ByteString) | ||
|
||
import Control.Monad.ST | ||
import Data.STRef | ||
|
||
-- | Basic data sink for testing | ||
newtype DataSink = DataSink (STRef RealWorld ByteString) | ||
|
||
newDataSink :: IO DataSink | ||
newDataSink = DataSink <$> (stToIO . newSTRef) mempty | ||
|
||
dataSinkWriter :: DataSink -> (ByteString -> IO()) | ||
dataSinkWriter (DataSink stref) chunk = stToIO (modifySTRef stref (chunk <>)) | ||
|
||
dataSinkResult :: DataSink -> IO ByteString | ||
dataSinkResult (DataSink stref) = (stToIO . readSTRef) stref |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters