diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-08-26 05:51:32 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-08-26 05:51:32 +0400 |
commit | c2047b0dc4f7dfd09765e9c9c2bdb92ff1b1e0f6 (patch) | |
tree | e4576c08bc3527400b19bf335bfacd560882c168 /src/Data/BEncode.hs | |
parent | 645a2f905f488b1eb978f46846cb5fe4ef017334 (diff) |
~ Document the Predicates section.
Diffstat (limited to 'src/Data/BEncode.hs')
-rw-r--r-- | src/Data/BEncode.hs | 6 |
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. | ||
555 | isInteger :: BEncode -> Bool | 556 | isInteger :: BEncode -> Bool |
556 | isInteger (BInteger _) = True | 557 | isInteger (BInteger _) = True |
557 | isInteger _ = False | 558 | isInteger _ = False |
558 | {-# INLINE isInteger #-} | 559 | {-# INLINE isInteger #-} |
559 | 560 | ||
561 | -- | Test if bencoded value is a string, both raw and utf8 encoded. | ||
560 | isString :: BEncode -> Bool | 562 | isString :: BEncode -> Bool |
561 | isString (BString _) = True | 563 | isString (BString _) = True |
562 | isString _ = False | 564 | isString _ = False |
563 | {-# INLINE isString #-} | 565 | {-# INLINE isString #-} |
564 | 566 | ||
567 | -- | Test if bencoded value is a list. | ||
565 | isList :: BEncode -> Bool | 568 | isList :: BEncode -> Bool |
566 | isList (BList _) = True | 569 | isList (BList _) = True |
567 | isList _ = False | 570 | isList _ = False |
568 | {-# INLINE isList #-} | 571 | {-# INLINE isList #-} |
569 | 572 | ||
573 | -- | Test if bencoded value is a dictionary. | ||
570 | isDict :: BEncode -> Bool | 574 | isDict :: BEncode -> Bool |
571 | isDict (BList _) = True | 575 | isDict (BList _) = True |
572 | isDict _ = False | 576 | isDict _ = False |