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.

  1. iforM_ :: (Monad m, Unbox a) => Vector a -> (Int -> a -> m b) -> m ()

    rebase Rebase.Data.Vector.Unboxed

    No documentation available.

  2. newtype DoNotUnboxNormalForm a

    rebase Rebase.Data.Vector.Unboxed.Base

    No documentation available.

  3. DoNotUnboxNormalForm :: a -> DoNotUnboxNormalForm a

    rebase Rebase.Data.Vector.Unboxed.Base

    No documentation available.

  4. iforM_ :: (PrimMonad m, Unbox a) => MVector (PrimState m) a -> (Int -> a -> m b) -> m ()

    rebase Rebase.Data.Vector.Unboxed.Mutable

    No documentation available.

  5. BlockedOnForeignCall :: BlockReason

    rebase Rebase.Prelude

    currently in a foreign call

  6. iso8601Format :: ISO8601 t => Format t

    rebase Rebase.Prelude

    The most commonly used ISO 8601 format for this type.

  7. runForget :: Forget r a (b :: k) -> a -> r

    rebase Rebase.Prelude

    No documentation available.

  8. package servant-foreign

    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

  9. class HasForeign (lang :: k) ftype api

    servant-foreign Servant.Foreign

    Implementation of the Servant framework types. Relevant instances: Everything containing HasForeignType.

  10. 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
    

Page 1309 of many | Previous | Next