diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-01 17:57:59 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-01 17:57:59 +0400 |
commit | 2abd00f548b7b9565b2a6bc1bed793d2a6f8c9cd (patch) | |
tree | d952650f8c7088d94d90582b9a59926c8224450f /src/Data/Torrent/Piece.hs | |
parent | 2749007675a6ff28979fa793b48ffe910635c708 (diff) |
Add functor instances to Block and Piece
Diffstat (limited to 'src/Data/Torrent/Piece.hs')
-rw-r--r-- | src/Data/Torrent/Piece.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Data/Torrent/Piece.hs b/src/Data/Torrent/Piece.hs index 7eb4e3d5..c6223348 100644 --- a/src/Data/Torrent/Piece.hs +++ b/src/Data/Torrent/Piece.hs | |||
@@ -7,8 +7,9 @@ | |||
7 | -- | 7 | -- |
8 | -- Pieces are used to validate torrent content. | 8 | -- Pieces are used to validate torrent content. |
9 | -- | 9 | -- |
10 | {-# LANGUAGE TemplateHaskell #-} | 10 | {-# LANGUAGE TemplateHaskell #-} |
11 | {-# LANGUAGE DeriveDataTypeable #-} | 11 | {-# LANGUAGE DeriveDataTypeable #-} |
12 | {-# LANGUAGE DeriveFunctor #-} | ||
12 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} | 13 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} |
13 | module Data.Torrent.Piece | 14 | module Data.Torrent.Piece |
14 | ( -- * Piece attributes | 15 | ( -- * Piece attributes |
@@ -115,7 +116,7 @@ data Piece a = Piece | |||
115 | 116 | ||
116 | -- | Payload. | 117 | -- | Payload. |
117 | , pieceData :: !a | 118 | , pieceData :: !a |
118 | } deriving (Show, Read, Eq, Typeable) | 119 | } deriving (Show, Read, Eq, Functor, Typeable) |
119 | 120 | ||
120 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''Piece) | 121 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''Piece) |
121 | 122 | ||