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.
typeFor :: HasForeignType lang ftype a => Proxy lang -> Proxy ftype -> Proxy a -> ftypeservant-foreign Servant.Foreign No documentation available.
-
servant-foreign Servant.Foreign.Internal No documentation available.
EmptyForeignAPI :: EmptyForeignAPIservant-foreign Servant.Foreign.Internal No documentation available.
class
HasForeign (lang :: k) ftype apiservant-foreign Servant.Foreign.Internal Implementation of the Servant framework types. Relevant instances: Everything containing HasForeignType.
class
HasForeignType (lang :: k) ftype (a :: k1)servant-foreign Servant.Foreign.Internal 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
typeFor :: HasForeignType lang ftype a => Proxy lang -> Proxy ftype -> Proxy a -> ftypeservant-foreign Servant.Foreign.Internal No documentation available.
-
This module calls the soxi command which is available since sox version 14. We have to call soxi for every option. However we hide this in our interface, such that we could do more efficiently, if soxi supports multiple outputs in future.
ErrorConstraintForeignKey :: Errorsqlite-simple Database.SQLite.Simple No documentation available.
-
sqlite-simple Database.SQLite.Simple Auxiliary database format error
typeHashForNames :: [Name] -> Q Expstore Data.Store.TypeHash.Internal At compiletime, this yields a hash of the specified datatypes. Not only does this cover the datatypes themselves, but also all transitive dependencies. The resulting expression is a literal of type TypeHash.