Safe Haskell | None |
---|---|
Language | Haskell2010 |
Servant.Kotlin
Synopsis
- generateKotlinForDefDataClass :: KotlinType a => Proxy a -> [Text]
- defKotlinImports :: Text
- generateKotlinForAPI :: (HasForeign LangKotlin KotlinClass api, GenerateList KotlinClass (Foreign KotlinClass api)) => Proxy api -> [Text]
- generateKotlinForAPIWith :: (HasForeign LangKotlin KotlinClass api, GenerateList KotlinClass (Foreign KotlinClass api)) => KotlinOptions -> Proxy api -> [Text]
- generateKotlinForAPIClass :: Text -> [Text] -> [Text]
- data KotlinOptions = KotlinOptions {}
- data UrlPrefix
- defKotlinOptions :: KotlinOptions
- data Spec = Spec {}
- specsToDir :: [Spec] -> FilePath -> IO ()
- class KotlinType a
- data Proxy (t :: k) :: forall k. k -> * = Proxy
Documentation
generateKotlinForDefDataClass :: KotlinType a => Proxy a -> [Text] Source #
generateKotlinForAPI :: (HasForeign LangKotlin KotlinClass api, GenerateList KotlinClass (Foreign KotlinClass api)) => Proxy api -> [Text] Source #
Generate Kotlin code for the API with default options. Returns a list of Kotlin functions to query your Servant API from Kotlin.
generateKotlinForAPIWith :: (HasForeign LangKotlin KotlinClass api, GenerateList KotlinClass (Foreign KotlinClass api)) => KotlinOptions -> Proxy api -> [Text] Source #
Generate Kotlin code for the API with custom options.
data KotlinOptions Source #
Options to configure how code is generated.
Constructors
KotlinOptions | |
Fields
|
defKotlinOptions :: KotlinOptions Source #
Default options for generating Kotlin code. The default options are: > { urlPrefix = Static "" > , emptyResponseKotlinTypes = [ toKotlinType NoContent ] > , stringKotlinTypes = [ toKotlinType "" ] > }
Convenience re-exports from the Kotlin module
class KotlinType a Source #
Instances
Convenience re-exports from Data.Proxy
data Proxy (t :: k) :: forall k. k -> * #
Proxy
is a type that holds no data, but has a phantom parameter of
arbitrary type (or even kind). Its use is to provide type information, even
though there is no value available of that type (or it may be too costly to
create one).
Historically,
is a safer alternative to the
Proxy
:: Proxy
a'undefined :: a'
idiom.
>>>
Proxy :: Proxy (Void, Int -> Int)
Proxy
Proxy can even hold types of higher kinds,
>>>
Proxy :: Proxy Either
Proxy
>>>
Proxy :: Proxy Functor
Proxy
>>>
Proxy :: Proxy complicatedStructure
Proxy
Constructors
Proxy |
Instances
Generic1 (Proxy :: k -> *) | |
Monad (Proxy :: * -> *) | Since: base-4.7.0.0 |
Functor (Proxy :: * -> *) | Since: base-4.7.0.0 |
Applicative (Proxy :: * -> *) | Since: base-4.7.0.0 |
Foldable (Proxy :: * -> *) | Since: base-4.7.0.0 |
Defined in Data.Foldable Methods fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> m # foldr :: (a -> b -> b) -> b -> Proxy a -> b # foldr' :: (a -> b -> b) -> b -> Proxy a -> b # foldl :: (b -> a -> b) -> b -> Proxy a -> b # foldl' :: (b -> a -> b) -> b -> Proxy a -> b # foldr1 :: (a -> a -> a) -> Proxy a -> a # foldl1 :: (a -> a -> a) -> Proxy a -> a # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # | |
Traversable (Proxy :: * -> *) | Since: base-4.7.0.0 |
Contravariant (Proxy :: * -> *) | |
Representable (Proxy :: * -> *) | |
Alternative (Proxy :: * -> *) | Since: base-4.9.0.0 |
MonadPlus (Proxy :: * -> *) | Since: base-4.9.0.0 |
Bounded (Proxy t) | |
Enum (Proxy s) | Since: base-4.7.0.0 |
Eq (Proxy s) | Since: base-4.7.0.0 |
Ord (Proxy s) | Since: base-4.7.0.0 |
Read (Proxy t) | Since: base-4.7.0.0 |
Show (Proxy s) | Since: base-4.7.0.0 |
Ix (Proxy s) | Since: base-4.7.0.0 |
Defined in Data.Proxy | |
Generic (Proxy t) | |
Semigroup (Proxy s) | Since: base-4.9.0.0 |
Monoid (Proxy s) | Since: base-4.7.0.0 |
KotlinType a => KotlinType (Proxy a) Source # | |
Defined in Servant.Kotlin.Type Methods toKotlinType :: Proxy a -> Maybe KotlinClass Source # | |
type Rep1 (Proxy :: k -> *) | |
type Rep (Proxy :: * -> *) | |
type Rep (Proxy t) | |