From c2047b0dc4f7dfd09765e9c9c2bdb92ff1b1e0f6 Mon Sep 17 00:00:00 2001 From: Sam T Date: Mon, 26 Aug 2013 05:51:32 +0400 Subject: ~ Document the Predicates section. --- src/Data/BEncode.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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 {-# INLINE (>--?) #-} {-------------------------------------------------------------------- - Predicated + Predicates --------------------------------------------------------------------} +-- | Test if bencoded value is an integer. isInteger :: BEncode -> Bool isInteger (BInteger _) = True isInteger _ = False {-# INLINE isInteger #-} +-- | Test if bencoded value is a string, both raw and utf8 encoded. isString :: BEncode -> Bool isString (BString _) = True isString _ = False {-# INLINE isString #-} +-- | Test if bencoded value is a list. isList :: BEncode -> Bool isList (BList _) = True isList _ = False {-# INLINE isList #-} +-- | Test if bencoded value is a dictionary. isDict :: BEncode -> Bool isDict (BList _) = True isDict _ = False -- cgit v1.2.3