-mkInfo :: BVal -> Maybe Info
-mkInfo (Bdict m) = let (Bint pieceLength') = m ! "piece length"
- (Bstr pieces') = m ! "pieces"
- private' = Nothing
- (Bstr name') = m ! "name"
- (Bint length') = m ! "length"
- md5sum' = Nothing
- in Just Info { pieceLength = pieceLength'
- , pieces = pieces'
- , private = private'
- , name = unpack name'
- , lengthInBytes = length'
- , md5sum = md5sum'}
-mkInfo _ = Nothing
+bvalToInfo :: BVal -> Maybe Info
+bvalToInfo (Bdict m) = let (Bint pieceLength') = m ! "piece length"
+ (Bstr pieces') = m ! "pieces"
+ private' = Nothing
+ (Bstr name') = m ! "name"
+ (Bint length') = m ! "length"
+ md5sum' = Nothing
+ in Just Info { pieceLength = pieceLength'
+ , pieces = pieces'
+ , private = private'
+ , name = unpack name'
+ , lengthInBytes = length'
+ , md5sum = md5sum'}
+bvalToInfo _ = Nothing