Hoogle Search
Within LTS Haskell 24.33 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
hal AWS.Lambda.Runtime For functions that can read the lambda context and use IO within the same monad. Use this for handlers that need any form of side-effect such as reading environment variables or making network requests, and prefer to access the AWS Lambda Context in the same monad. However, do not use this runtime if you need stateful (caching) behaviors.
{-# LANGUAGE NamedFieldPuns, DeriveGeneric #-} module Main where import AWS.Lambda.Context (LambdaContext(..)) import AWS.Lambda.Runtime (readerTRuntime) import Control.Monad.Reader (ReaderT, ask) import Control.Monad.Trans (liftIO) import Data.Aeson (FromJSON) import Data.Text (unpack) import System.Environment (getEnv) import GHC.Generics (Generic) data Named = Named { name :: String } deriving Generic instance FromJSON Named myHandler :: Named -> ReaderT LambdaContext IO String myHandler Named { name } = do LambdaContext { functionName } <- ask greeting <- liftIO $ getEnv "GREETING" return $ greeting ++ name ++ " from " ++ unpack functionName ++ "!" main :: IO () main = readerTRuntime myHandler readerTRuntime :: ToJSON result => (Value -> ReaderT LambdaContext IO result) -> IO ()hal AWS.Lambda.Runtime.Value For functions that can read the lambda context and use IO within the same monad. Use this for handlers that need any form of side-effect such as reading environment variables or making network requests, and prefer to access the AWS Lambda Context in the same monad. However, do not use this runtime if you need stateful (caching) behaviors.
{-# LANGUAGE NamedFieldPuns, DeriveGeneric #-} module Main where import AWS.Lambda.Context (LambdaContext(..)) import AWS.Lambda.Runtime (readerTRuntime) import Control.Monad.Reader (ReaderT, ask) import Control.Monad.Trans (liftIO) import Data.Aeson (Value, FromJSON, parseJSON) import Data.Aeson.Types (parseMaybe) import Data.Text (unpack) import System.Environment (getEnv) import GHC.Generics (Generic) data Named = Named { name :: String } deriving Generic instance FromJSON Named myHandler :: Value -> ReaderT LambdaContext IO String myHandler jsonAst = case parseMaybe parseJSON jsonAst of Nothing -> return $ "My name is HAL, what's yours?" Just Named { name } -> do LambdaContext { functionName } <- ask greeting <- liftIO $ getEnv "GREETING" return $ greeting ++ name ++ " from " ++ unpack functionName ++ "!" main :: IO () main = readerTRuntime myHandler-
heftia-effects Control.Monad.Hefty.Concurrent.Subprocess No documentation available.
-
heftia-effects Control.Monad.Hefty.Concurrent.Subprocess No documentation available.
-
heftia-effects Control.Monad.Hefty.Concurrent.Subprocess No documentation available.
-
heftia-effects Control.Monad.Hefty.Concurrent.Subprocess No documentation available.
readConfig :: FromJSON a => FilePath -> IO (Config a)hie-bios HIE.Bios.Config No documentation available.
-
hie-bios HIE.Bios.Cradle Wrapper around readCreateProcess that sets the working directory and clears the environment, suitable for invoking cabal/stack and raw ghc commands.
-
hie-bios HIE.Bios.Cradle Call a given process with temp files for the process to write to. * The process can discover the temp files paths by reading the environment. * The contents of the temp files are returned by this function, if any. * The logging function is called every time the process emits anything to stdout or stderr. it can be used to report progress of the process to a user. * The process is executed in the given directory.
-
hie-bios HIE.Bios.Process Wrapper around readCreateProcess that sets the working directory and clears the environment, suitable for invoking cabal/stack and raw ghc commands.