diff options
Diffstat (limited to 'src/Data/Torrent/Layout.hs')
-rw-r--r-- | src/Data/Torrent/Layout.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Data/Torrent/Layout.hs b/src/Data/Torrent/Layout.hs index a4b55b3d..ef8d45eb 100644 --- a/src/Data/Torrent/Layout.hs +++ b/src/Data/Torrent/Layout.hs | |||
@@ -71,6 +71,7 @@ import Data.BEncode.Types | |||
71 | import Data.ByteString as BS | 71 | import Data.ByteString as BS |
72 | import Data.ByteString.Base16 as Base16 | 72 | import Data.ByteString.Base16 as Base16 |
73 | import Data.ByteString.Char8 as BC | 73 | import Data.ByteString.Char8 as BC |
74 | import Data.Default | ||
74 | import Data.Foldable as F | 75 | import Data.Foldable as F |
75 | import Data.List as L | 76 | import Data.List as L |
76 | import Data.Text as T | 77 | import Data.Text as T |
@@ -222,6 +223,10 @@ instance NFData LayoutInfo where | |||
222 | rnf SingleFile {..} = () | 223 | rnf SingleFile {..} = () |
223 | rnf MultiFile {..} = rnf liFiles | 224 | rnf MultiFile {..} = rnf liFiles |
224 | 225 | ||
226 | -- | Empty multifile layout. | ||
227 | instance Default LayoutInfo where | ||
228 | def = MultiFile [] "" | ||
229 | |||
225 | getLayoutInfo :: Get LayoutInfo | 230 | getLayoutInfo :: Get LayoutInfo |
226 | getLayoutInfo = single <|> multi | 231 | getLayoutInfo = single <|> multi |
227 | where | 232 | where |