summaryrefslogtreecommitdiff
path: root/src/Data/BEncode.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data/BEncode.hs')
-rw-r--r--src/Data/BEncode.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Data/BEncode.hs b/src/Data/BEncode.hs
index fee2774..0f32386 100644
--- a/src/Data/BEncode.hs
+++ b/src/Data/BEncode.hs
@@ -549,24 +549,28 @@ optKey d key
549{-# INLINE (>--?) #-} 549{-# INLINE (>--?) #-}
550 550
551{-------------------------------------------------------------------- 551{--------------------------------------------------------------------
552 Predicated 552 Predicates
553--------------------------------------------------------------------} 553--------------------------------------------------------------------}
554 554
555-- | Test if bencoded value is an integer.
555isInteger :: BEncode -> Bool 556isInteger :: BEncode -> Bool
556isInteger (BInteger _) = True 557isInteger (BInteger _) = True
557isInteger _ = False 558isInteger _ = False
558{-# INLINE isInteger #-} 559{-# INLINE isInteger #-}
559 560
561-- | Test if bencoded value is a string, both raw and utf8 encoded.
560isString :: BEncode -> Bool 562isString :: BEncode -> Bool
561isString (BString _) = True 563isString (BString _) = True
562isString _ = False 564isString _ = False
563{-# INLINE isString #-} 565{-# INLINE isString #-}
564 566
567-- | Test if bencoded value is a list.
565isList :: BEncode -> Bool 568isList :: BEncode -> Bool
566isList (BList _) = True 569isList (BList _) = True
567isList _ = False 570isList _ = False
568{-# INLINE isList #-} 571{-# INLINE isList #-}
569 572
573-- | Test if bencoded value is a dictionary.
570isDict :: BEncode -> Bool 574isDict :: BEncode -> Bool
571isDict (BList _) = True 575isDict (BList _) = True
572isDict _ = False 576isDict _ = False