License | BSD-3 |
---|---|
Maintainer | autotaker@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data DynamicShow
- data Dynamic
- castMethod :: (ToDyn (Args method) (Args method'), FromDyn (Ret method) (Ret method'), Method method, Method method', Base method ~ Base method') => method -> method'
- dynArg :: (Typeable a, DynamicLike b) => Matcher a -> Matcher b
- class DynamicLike a where
- class FromDyn a b where
- fromDyn :: a -> b
- class ToDyn a b where
- toDyn :: b -> a
- class Typeable (a :: k)
Documentation
data DynamicShow Source #
Dynamic value whose content is showable.
Using this type instead of Dynamic
is recommended because it gives better error messages.
Instances
Show DynamicShow Source # | |
Defined in Test.Method.Dynamic showsPrec :: Int -> DynamicShow -> ShowS # show :: DynamicShow -> String # showList :: [DynamicShow] -> ShowS # | |
DynamicLike DynamicShow Source # | |
Defined in Test.Method.Dynamic asDyn :: DynamicShow -> Dynamic Source # | |
(Typeable a, Show a) => ToDyn DynamicShow a Source # | |
Defined in Test.Method.Dynamic toDyn :: a -> DynamicShow Source # | |
(Typeable a, Show a) => FromDyn DynamicShow a Source # | |
Defined in Test.Method.Dynamic fromDyn :: DynamicShow -> a Source # |
A value of type Dynamic
is an object encapsulated together with its type.
A Dynamic
may only represent a monomorphic value; an attempt to
create a value of type Dynamic
from a polymorphically-typed
expression will result in an ambiguity error (see toDyn
).
Show
ing a value of type Dynamic
returns a pretty-printed representation
of the object's type; useful for debugging.
Instances
Show Dynamic | Since: base-2.1 |
Exception Dynamic | Since: base-4.0.0.0 |
Defined in Data.Dynamic toException :: Dynamic -> SomeException # fromException :: SomeException -> Maybe Dynamic # displayException :: Dynamic -> String # | |
DynamicLike Dynamic Source # | |
Typeable a => ToDyn Dynamic a Source # | |
Defined in Test.Method.Dynamic | |
Typeable a => FromDyn Dynamic a Source # | |
Defined in Test.Method.Dynamic |
castMethod :: (ToDyn (Args method) (Args method'), FromDyn (Ret method) (Ret method'), Method method, Method method', Base method ~ Base method') => method -> method' Source #
convert a dynamically-typed method to a polymorphic method.
fDyn :: String -> DynamicShow -> Dynamic -> IO [DynamicShow] fDyn = ... fPoly :: (Typeable a, Show a, Typeable b, Typeable c, Show c) => String -> a -> b -> IO [c] fPoly = castMethod fDyn
dynArg :: (Typeable a, DynamicLike b) => Matcher a -> Matcher b Source #
Convert given matcher to dynamic matcher. The dynamic matcher matches a dynamic value only if the value has the type of given matcher.
class DynamicLike a where Source #
Generalizes Dynamic
and DynamicShow
Instances
DynamicLike Dynamic Source # | |
DynamicLike DynamicShow Source # | |
Defined in Test.Method.Dynamic asDyn :: DynamicShow -> Dynamic Source # |
class FromDyn a b where Source #
FromDyn a b
provides a function to convert type a
to type b
,
where b
is a type whose dynamic type occurences are replaced by concrete types.
For example: FromDyn (Int, Dynamic, Maybe Dynamic) (Int, Bool, Maybe String)
Nothing
convert dynamic value to specified type. It thows runtime exception if the dynamic value does not have specified type.
Instances
FromDyn a a Source # | |
Defined in Test.Method.Dynamic | |
Typeable a => FromDyn Dynamic a Source # | |
Defined in Test.Method.Dynamic | |
(Typeable a, Show a) => FromDyn DynamicShow a Source # | |
Defined in Test.Method.Dynamic fromDyn :: DynamicShow -> a Source # | |
FromDyn a b => FromDyn [a] [b] Source # | |
Defined in Test.Method.Dynamic | |
FromDyn a b => FromDyn (Maybe a) (Maybe b) Source # | |
(ToDyn a a', FromDyn b b') => FromDyn (a -> b) (a' -> b') Source # | |
Defined in Test.Method.Dynamic | |
(FromDyn a a', FromDyn b b') => FromDyn (Either a b) (Either a' b') Source # | |
(FromDyn a a', FromDyn b b') => FromDyn (a, b) (a', b') Source # | |
Defined in Test.Method.Dynamic | |
(FromDyn a b, FromDyn c d) => FromDyn (a :* c) (b :* d) Source # | |
(FromDyn a a', FromDyn b b', FromDyn c c') => FromDyn (a, b, c) (a', b', c') Source # | |
Defined in Test.Method.Dynamic | |
(FromDyn a a', FromDyn b b', FromDyn c c', FromDyn d d') => FromDyn (a, b, c, d) (a', b', c', d') Source # | |
Defined in Test.Method.Dynamic | |
(FromDyn a a', FromDyn b b', FromDyn c c', FromDyn d d', FromDyn e e') => FromDyn (a, b, c, d, e) (a', b', c', d', e') Source # | |
Defined in Test.Method.Dynamic | |
(FromDyn a a', FromDyn b b', FromDyn c c', FromDyn d d', FromDyn e e', FromDyn f f') => FromDyn (a, b, c, d, e, f) (a', b', c', d', e', f') Source # | |
Defined in Test.Method.Dynamic | |
(FromDyn a a', FromDyn b b', FromDyn c c', FromDyn d d', FromDyn e e', FromDyn f f', FromDyn g g') => FromDyn (a, b, c, d, e, f, g) (a', b', c', d', e', f', g') Source # | |
Defined in Test.Method.Dynamic |
class ToDyn a b where Source #
ToDyn a b
provides a function to convert type b
to type a
, where
b
is a type whose dynamic type occurences are replaced by concrete types.
For example: ToDyn (Int, Dynamic, Maybe Dynamic) (Int, Bool, Maybe String)
Nothing
convert value of specified type to dynamic value
Instances
ToDyn a a Source # | |
Defined in Test.Method.Dynamic | |
Typeable a => ToDyn Dynamic a Source # | |
Defined in Test.Method.Dynamic | |
(Typeable a, Show a) => ToDyn DynamicShow a Source # | |
Defined in Test.Method.Dynamic toDyn :: a -> DynamicShow Source # | |
ToDyn a b => ToDyn [a] [b] Source # | |
Defined in Test.Method.Dynamic | |
ToDyn a b => ToDyn (Maybe a) (Maybe b) Source # | |
(FromDyn a a', ToDyn b b') => ToDyn (a -> b) (a' -> b') Source # | |
Defined in Test.Method.Dynamic | |
(ToDyn a a', ToDyn b b') => ToDyn (Either a b) (Either a' b') Source # | |
(ToDyn a a', ToDyn b b') => ToDyn (a, b) (a', b') Source # | |
Defined in Test.Method.Dynamic | |
(ToDyn a b, ToDyn c d) => ToDyn (a :* c) (b :* d) Source # | |
(ToDyn a a', ToDyn b b', ToDyn c c') => ToDyn (a, b, c) (a', b', c') Source # | |
Defined in Test.Method.Dynamic | |
(ToDyn a a', ToDyn b b', ToDyn c c', ToDyn d d') => ToDyn (a, b, c, d) (a', b', c', d') Source # | |
Defined in Test.Method.Dynamic | |
(ToDyn a a', ToDyn b b', ToDyn c c', ToDyn d d', ToDyn e e') => ToDyn (a, b, c, d, e) (a', b', c', d', e') Source # | |
Defined in Test.Method.Dynamic | |
(ToDyn a a', ToDyn b b', ToDyn c c', ToDyn d d', ToDyn e e', ToDyn f f') => ToDyn (a, b, c, d, e, f) (a', b', c', d', e', f') Source # | |
Defined in Test.Method.Dynamic | |
(ToDyn a a', ToDyn b b', ToDyn c c', ToDyn d d', ToDyn e e', ToDyn f f', ToDyn g g') => ToDyn (a, b, c, d, e, f, g) (a', b', c', d', e', f', g') Source # | |
Defined in Test.Method.Dynamic |