Hoogle Search
Within LTS Haskell 24.66 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
iforM_ :: (Monad m, Unbox a) => Vector a -> (Int -> a -> m b) -> m ()rebase Rebase.Data.Vector.Unboxed No documentation available.
newtype
DoNotUnboxNormalForm arebase Rebase.Data.Vector.Unboxed.Base No documentation available.
DoNotUnboxNormalForm :: a -> DoNotUnboxNormalForm arebase Rebase.Data.Vector.Unboxed.Base No documentation available.
iforM_ :: (PrimMonad m, Unbox a) => MVector (PrimState m) a -> (Int -> a -> m b) -> m ()rebase Rebase.Data.Vector.Unboxed.Mutable No documentation available.
BlockedOnForeignCall :: BlockReasonrebase Rebase.Prelude currently in a foreign call
iso8601Format :: ISO8601 t => Format trebase Rebase.Prelude The most commonly used ISO 8601 format for this type.
runForget :: Forget r a (b :: k) -> a -> rrebase Rebase.Prelude No documentation available.
-
Helpers for generating clients for servant APIs in any programming language Helper types and functions for generating client functions for servant APIs in any programming language This package provides types and functions that collect all the data needed to generate client functions in the programming language of your choice. This effectively means you only have to write the code that "pretty-prints" this data as some code in your target language. See the servant-js package for an example CHANGELOG
class
HasForeign (lang :: k) ftype apiservant-foreign Servant.Foreign Implementation of the Servant framework types. Relevant instances: Everything containing HasForeignType.
class
HasForeignType (lang :: k) ftype (a :: k1)servant-foreign Servant.Foreign HasForeignType maps Haskell types with types in the target language of your backend. For example, let's say you're implementing a backend to some language X, and you want a Text representation of each input/output type mentioned in the API:
-- First you need to create a dummy type to parametrize your -- instances. data LangX -- Otherwise you define instances for the types you need instance HasForeignType LangX Text Int where typeFor _ _ _ = "intX" -- Or for example in case of lists instance HasForeignType LangX Text a => HasForeignType LangX Text [a] where typeFor lang ftype _ = "listX of " <> typeFor lang ftype (Proxy :: Proxy a)
Finally to generate list of information about all the endpoints for an API you create a function of a form:getEndpoints :: (HasForeign LangX Text api, GenerateList Text (Foreign Text api)) => Proxy api -> [Req Text] getEndpoints api = listFromAPI (Proxy :: Proxy LangX) (Proxy :: Proxy Text) api
-- If language __X__ is dynamically typed then you can use -- a predefined NoTypes parameter with the NoContent output type:
getEndpoints :: (HasForeign NoTypes NoContent api, GenerateList Text (Foreign NoContent api)) => Proxy api -> [Req NoContent] getEndpoints api = listFromAPI (Proxy :: Proxy NoTypes) (Proxy :: Proxy NoContent) api