summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-08-26 05:51:32 +0400
committerSam T <pxqr.sta@gmail.com>2013-08-26 05:51:32 +0400
commitc2047b0dc4f7dfd09765e9c9c2bdb92ff1b1e0f6 (patch)
treee4576c08bc3527400b19bf335bfacd560882c168 /src
parent645a2f905f488b1eb978f46846cb5fe4ef017334 (diff)
~ Document the Predicates section.
Diffstat (limited to 'src')
-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