| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Leanpub.Concepts
Synopsis
- newtype ApiSecretKey = ApiSecretKey Text
- newtype BookSlug = BookSlug Text
- bookURL :: BookSlug -> Text
- newtype CouponCode = CouponCode Text
- couponURL :: BookSlug -> CouponCode -> Text
- data CouponMaxUses
- data CouponNote = CouponNote Text
API
newtype ApiSecretKey Source #
Get an API key from the Leanpub dashboard. This API key should be kept private; treat it just like your password to your Leanpub account.
Constructors
| ApiSecretKey Text |
Books
An identifier for a book. E.g. if your book is found at
https://leanpub.com/your_book
then your book's slug is your_book.
bookURL :: BookSlug -> Text Source #
>>>:set -XOverloadedStrings>>>bookURL (BookSlug "your_book")"https://leanpub.com/your_book"
Coupons
newtype CouponCode Source #
An identifier for a coupon.
Constructors
| CouponCode Text |
Instances
| Show CouponCode Source # | |
Defined in Leanpub.Concepts Methods showsPrec :: Int -> CouponCode -> ShowS # show :: CouponCode -> String # showList :: [CouponCode] -> ShowS # | |
couponURL :: BookSlug -> CouponCode -> Text Source #
E.g. if your book's slug is your_book and the coupon code is black_friday then users can use your coupon via the URL:
https://leanpub.com/your_book/c/black_friday
(Don't just give the code at the end of the coupon to your potential customers, since there's nowhere to type it in on the checkout form.)
>>>:set -XOverloadedStrings>>>couponURL (BookSlug "your_book") (CouponCode "black_friday")"https://leanpub.com/your_book/c/black_friday"
data CouponMaxUses Source #
Constructors
| CouponUseUnlimited | There is no limit to how many times the coupon may be used. |
| CouponMaxUses Natural | The maximum number of times the coupon may be used. |
Instances
| Show CouponMaxUses Source # | |
Defined in Leanpub.Concepts Methods showsPrec :: Int -> CouponMaxUses -> ShowS # show :: CouponMaxUses -> String # showList :: [CouponMaxUses] -> ShowS # | |
data CouponNote Source #
A description of a coupon. This is just used to remind you of what it was for; it is not visible to users.
Constructors
| CouponNote Text |
Instances
| Show CouponNote Source # | |
Defined in Leanpub.Concepts Methods showsPrec :: Int -> CouponNote -> ShowS # show :: CouponNote -> String # showList :: [CouponNote] -> ShowS # | |