| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Web.Stripe.Test.Prelude
- ($) :: (a -> b) -> a -> b
- (-&-) :: StripeHasParam request param => StripeRequest request -> param -> StripeRequest request
- data Char :: *
- class Functor f
- data IO a :: * -> *
- type String = [Char]
- error :: HasCallStack => [Char] -> a
- module GHC.Num
- id :: a -> a
- (.) :: (b -> c) -> (a -> b) -> a -> c
- length :: Foldable t => forall a. t a -> Int
- undefined :: HasCallStack => a
- return :: Monad m => a -> m a
- (>>=) :: (StripeLift t, Monad m, LiftedType t ~ m a) => t -> (a -> m b) -> m b
- (>>) :: (StripeLift t, Monad m, LiftedType t ~ m a) => t -> m b -> m b
- fail :: Monad m => String -> m a
- void :: FromJSON (StripeReturn a) => StripeRequest a -> Stripe ()
- liftIO :: IO a -> Stripe a
- fromString :: IsString a => String -> a
- stripeLift :: StripeLift a => a -> LiftedType a
- module Test.Hspec
- class Eq a where
- data Bool :: *
- data Maybe a :: * -> *
- type Stripe = FreeT StripeRequestF IO
- data StripeRequestF ret = StripeRequestF {
- getStripeRequest :: StripeRequest req
- decode :: Value -> Result ret
- type StripeSpec = (forall a. Stripe a -> IO (Either StripeError a)) -> Spec
Documentation
($) :: (a -> b) -> a -> b infixr 0 #
Application operator. This operator is redundant, since ordinary application (f x) means the same as (f . However, $ x)$ has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; for example:
f $ g $ h x = f (g (h x))
It is also useful in higher-order situations, such as , or map ($ 0) xs.zipWith ($) fs xs
(-&-) :: StripeHasParam request param => StripeRequest request -> param -> StripeRequest request #
add an optional parameter to a StripeRequest
The character type Char is an enumeration whose values represent Unicode (or equivalently ISO/IEC 10646) characters (see http://www.unicode.org/ for details). This set extends the ISO 8859-1 (Latin-1) character set (the first 256 characters), which is itself an extension of the ASCII character set (the first 128 characters). A character literal in Haskell has type Char.
To convert a Char to or from the corresponding Int value defined by Unicode, use toEnum and fromEnum from the Enum class respectively (or equivalently ord and chr).
Instances
| Eq Char | |
| Ord Char | |
| Show Char | |
| Lift Char | |
| FromJSON Char | |
| FromJSONKey Char | |
| Random Char | |
| ErrorList Char | |
| Unbox Char | |
| Vector Vector Char | |
| MVector MVector Char | |
| Functor (URec Char) | |
| IsString (Seq Char) | |
| Foldable (URec Char) | |
| Generic1 (URec Char) | |
| Eq (URec Char p) | |
| Ord (URec Char p) | |
| Show (URec Char p) | |
| Generic (URec Char p) | |
| data URec Char | Used for marking occurrences of |
| data Vector Char | |
| data MVector s Char | |
| type Rep1 (URec Char) | |
| type Rep (URec Char p) | |
The Functor class is used for types that can be mapped over. Instances of Functor should satisfy the following laws:
fmap id == id fmap (f . g) == fmap f . fmap g
The instances of Functor for lists, Maybe and IO satisfy these laws.
Minimal complete definition
Instances
A value of type is a computation which, when performed, does some I/O before returning a value of type IO aa.
There is really only one way to "perform" an I/O action: bind it to Main.main in your program. When your program is run, the I/O will be performed. It isn't possible to perform I/O from an arbitrary function, unless that function is itself in the IO monad and called at some point, directly or indirectly, from Main.main.
IO is a monad, so IO actions can be combined using either the do-notation or the >> and >>= operations from the Monad class.
error :: HasCallStack => [Char] -> a #
error stops execution and displays an error message.
module GHC.Num
length :: Foldable t => forall a. t a -> Int #
Returns the size/length of a finite structure as an Int. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.
undefined :: HasCallStack => a #
void :: FromJSON (StripeReturn a) => StripeRequest a -> Stripe () Source #
fromString :: IsString a => String -> a #
stripeLift :: StripeLift a => a -> LiftedType a Source #
module Test.Hspec
The Eq class defines equality (==) and inequality (/=). All the basic datatypes exported by the Prelude are instances of Eq, and Eq may be derived for any datatype whose constituents are also instances of Eq.
Instances
Instances
| Eq Bool | |
| Ord Bool | |
| Show Bool | |
| Generic Bool | |
| Lift Bool | |
| Testable Bool | |
| FromJSON Bool | |
| FromJSONKey Bool | |
| Example Bool | |
| Random Bool | |
| Unbox Bool | |
| SingI Bool False | |
| SingI Bool True | |
| Vector Vector Bool | |
| MVector MVector Bool | |
| SingKind Bool (KProxy Bool) | |
| type Rep Bool | |
| data Sing Bool | |
| type Arg Bool | |
| data Vector Bool | |
| data MVector s Bool | |
| type (==) Bool a b | |
| type DemoteRep Bool (KProxy Bool) | |
The Maybe type encapsulates an optional value. A value of type either contains a value of type Maybe aa (represented as ), or it is empty (represented as Just aNothing). Using Maybe is a good way to deal with errors or exceptional cases without resorting to drastic measures such as error.
The Maybe type is also a monad. It is a simple kind of error monad, where all errors are represented by Nothing. A richer error monad can be built using the Either type.
Instances
| Monad Maybe | |
| Functor Maybe | |
| Applicative Maybe | |
| Foldable Maybe | |
| Generic1 Maybe | |
| FromJSON1 Maybe | |
| Alternative Maybe | |
| MonadPlus Maybe | |
| (Selector Meta s, FromJSON a) => FromRecord arity (S1 s (K1 i (Maybe a))) | |
| Eq a => Eq (Maybe a) | |
| Ord a => Ord (Maybe a) | |
| Show a => Show (Maybe a) | |
| Generic (Maybe a) | |
| Semigroup a => Semigroup (Maybe a) | |
| Monoid a => Monoid (Maybe a) | Lift a semigroup into |
| Lift a => Lift (Maybe a) | |
| FromJSON a => FromJSON (Maybe a) | |
| SingI (Maybe a) (Nothing a) | |
| SingKind a (KProxy a) => SingKind (Maybe a) (KProxy (Maybe a)) | |
| SingI a a1 => SingI (Maybe a) (Just a a1) | |
| type Rep1 Maybe | |
| type Rep (Maybe a) | |
| data Sing (Maybe a) | |
| type (==) (Maybe k) a b | |
| type DemoteRep (Maybe a) (KProxy (Maybe a)) | |
data StripeRequestF ret Source #
Constructors
| StripeRequestF | |
Fields
| |
Instances
type StripeSpec = (forall a. Stripe a -> IO (Either StripeError a)) -> Spec Source #