diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-03-10 13:12:24 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-03-10 13:35:31 -0400 |
commit | 8cb9381befed4174624edfc80e09185c9340b4f6 (patch) | |
tree | e5d2041ff38502b1f8a5ef9caa6515cccfcea555 /Types/Transfer.hs | |
parent | e230fd58b5f5d5d16f87e1bd5c0f2e553f2ae5a2 (diff) |
AssociatedFile newtype
To prevent any further mistakes like 1a497cefb47557f0b4788c606f9071be422b2511
This commit was sponsored by Francois Marier on Patreon.
Diffstat (limited to 'Types/Transfer.hs')
-rw-r--r-- | Types/Transfer.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Types/Transfer.hs b/Types/Transfer.hs index 349eccf4b..ade8fc763 100644 --- a/Types/Transfer.hs +++ b/Types/Transfer.hs @@ -36,13 +36,13 @@ data TransferInfo = TransferInfo , transferTid :: Maybe ThreadId , transferRemote :: Maybe Remote , bytesComplete :: Maybe Integer - , associatedFile :: Maybe FilePath + , associatedFile :: AssociatedFile , transferPaused :: Bool } deriving (Show, Eq, Ord) stubTransferInfo :: TransferInfo -stubTransferInfo = TransferInfo Nothing Nothing Nothing Nothing Nothing Nothing False +stubTransferInfo = TransferInfo Nothing Nothing Nothing Nothing Nothing (AssociatedFile Nothing) False data Direction = Upload | Download deriving (Eq, Ord, Show, Read) @@ -64,5 +64,5 @@ instance Arbitrary TransferInfo where <*> pure Nothing -- remote not needed <*> arbitrary -- associated file cannot be empty (but can be Nothing) - <*> arbitrary `suchThat` (/= Just "") + <*> (AssociatedFile <$> arbitrary `suchThat` (/= Just "")) <*> arbitrary |