summaryrefslogtreecommitdiff
path: root/Network/Gravatar.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Network/Gravatar.hs')
-rw-r--r--Network/Gravatar.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/Network/Gravatar.hs b/Network/Gravatar.hs
index 12fe9f1..c9a9c3f 100644
--- a/Network/Gravatar.hs
+++ b/Network/Gravatar.hs
@@ -13,6 +13,15 @@
-- Return the URL of a gravatar image - an image associated with an
-- email address.
--
+-- Simple use:
+--
+-- > > gravatar "dons@galois.com"
+-- > "http://www.gravatar.com/avatar.php?gravatar_id=f21827076a1d0725c4f4bd5a640102e9"
+--
+-- Optional arguments to specify the maximum classification rating
+-- allowed, a size of the image (between 1 and 80 pixels) and a default url
+-- to redirect to are provided by 'gravatarWith'.
+--
module Network.Gravatar (
gravatar, gravatarWith
@@ -35,6 +44,7 @@ data Rating = G | PG | R | X
-- | An image size in pixels from 1 to 80.
newtype Size = Size Int
+ deriving (Eq,Ord,Show)
-- | A smart constructor for the Size type, ensuring it is between 1 and 80
size :: Int -> Maybe Size
@@ -53,7 +63,8 @@ gravatar :: String -> String
gravatar who = gravatarWith who Nothing Nothing Nothing
-- | Construct the url of a gravatar with optional classification
--- ratings, an optional size, and optional default image.
+-- rating to limit to, an optional size in pixels, and optional default
+-- url to redirect to, should no image be found.
--
gravatarWith :: String
-> Maybe Rating