Safe Haskell | None |
---|---|
Language | Haskell2010 |
Servant types and client for the API
Synopsis
- basicTranslate :: Manager -> AuthToken -> Maybe Language -> Language -> Text -> IO (Either TranslatorException Text)
- basicTranslateArray :: Manager -> AuthToken -> Language -> Language -> [Text] -> IO (Either TranslatorException ArrayResponse)
- data TranslatorException
- data Language
- = Afrikaans
- | Arabic
- | Bosnian
- | Bulgarian
- | Catalan
- | ChineseSimplified
- | ChineseTraditional
- | Croatian
- | Czech
- | Danish
- | Dutch
- | English
- | Estonian
- | Finnish
- | French
- | German
- | Greek
- | HaitianCreole
- | Hebrew
- | Hindi
- | HmongDaw
- | Hungarian
- | Indonesian
- | Italian
- | Japanese
- | Kiswahili
- | Klingon
- | KlingonPIqaD
- | Korean
- | Latvian
- | Lithuanian
- | Malay
- | Maltese
- | Norwegian
- | Persian
- | Polish
- | Portuguese
- | QueretaroOtomi
- | Romanian
- | Russian
- | SerbianCyrillic
- | SerbianLatin
- | Slovak
- | Slovenian
- | Spanish
- | Swedish
- | Thai
- | Turkish
- | Ukrainian
- | Urdu
- | Vietnamese
- | Welsh
- | YucatecMaya
- data ArrayRequest = ArrayRequest {}
- newtype ArrayResponse = ArrayResponse {}
- data TransItem = TransItem {
- transText :: Text
- originalBreaks :: [Int]
- translatedBreaks :: [Int]
Documentation
basicTranslate :: Manager -> AuthToken -> Maybe Language -> Language -> Text -> IO (Either TranslatorException Text) Source #
Most basic possible text translation function. For typical use-cases it will be much
more convenient to use functions from the Microsoft.Translator module, namely
translateIO
. See the README example.
basicTranslateArray :: Manager -> AuthToken -> Language -> Language -> [Text] -> IO (Either TranslatorException ArrayResponse) Source #
Most basic possible text list translation function. For typical use-cases it will
be much more convenient to use functions from the Microsoft.Translator module, namely
translateArrayIO
. See the README example.
data TranslatorException Source #
Instances
Show TranslatorException Source # | |
Defined in Microsoft.Translator.Exception showsPrec :: Int -> TranslatorException -> ShowS # show :: TranslatorException -> String # showList :: [TranslatorException] -> ShowS # | |
Exception TranslatorException Source # | |
Languages supported by MS Microsoft.Translator
Instances
ToHttpApiData Language Source # | |
Defined in Microsoft.Translator.Language toUrlPiece :: Language -> Text # toEncodedUrlPiece :: Language -> Builder # toHeader :: Language -> ByteString # toQueryParam :: Language -> Text # |
data ArrayRequest Source #
newtype ArrayResponse Source #
Instances
Show ArrayResponse Source # | |
Defined in Microsoft.Translator.API showsPrec :: Int -> ArrayResponse -> ShowS # show :: ArrayResponse -> String # showList :: [ArrayResponse] -> ShowS # | |
Generic ArrayResponse Source # | |
Defined in Microsoft.Translator.API type Rep ArrayResponse :: Type -> Type # from :: ArrayResponse -> Rep ArrayResponse x # to :: Rep ArrayResponse x -> ArrayResponse # | |
type Rep ArrayResponse Source # | |
Defined in Microsoft.Translator.API type Rep ArrayResponse = D1 (MetaData "ArrayResponse" "Microsoft.Translator.API" "microsoft-translator-0.1.2-2WixOZLIJMQ2W9Ir6On7A3" True) (C1 (MetaCons "ArrayResponse" PrefixI True) (S1 (MetaSel (Just "getArrayResponse") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [TransItem]))) |
TransItem | |
|
Instances
Show TransItem Source # | |
Generic TransItem Source # | |
type Rep TransItem Source # | |
Defined in Microsoft.Translator.API type Rep TransItem = D1 (MetaData "TransItem" "Microsoft.Translator.API" "microsoft-translator-0.1.2-2WixOZLIJMQ2W9Ir6On7A3" False) (C1 (MetaCons "TransItem" PrefixI True) (S1 (MetaSel (Just "transText") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: (S1 (MetaSel (Just "originalBreaks") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Int]) :*: S1 (MetaSel (Just "translatedBreaks") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Int])))) |