Skip to content

Commit a6a4c99

Browse files
committed
Added ScopedTypeVariables to the template and documentation.
1 parent 1cc5a39 commit a6a4c99

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

doc/03-configuring-the-dispatcher.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,21 @@ To continue the person age validator lambda, activate `TemplateHaskell` for enab
2020
Then, import the `Aws.Lambda` module:
2121

2222
```haskell
23-
{-# LANGUAGE TemplateHaskell #-}
23+
{-# LANGUAGE TemplateHaskell #-}
24+
{-# LANGUAGE ScopedTypeVariables #-}
2425

2526
module Main where
2627
import Aws.Lambda
2728
```
2829

29-
After this, add a line with the following statement:
30+
After this, add the following lines:
3031

3132
```haskell
33+
-- Use this action if you want to have context that is shared between lambda calls.
34+
-- It is called once per every cold start. We do not wish to have a shared context for our lambda, so we simply use Unit.
35+
initializeContext :: IO ()
36+
initializeContext = return ()
37+
3238
generateLambdaDispatcher StandaloneLambda defaultDispatcherOptions
3339
```
3440

stack-template.hsfiles

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ executables:
3333
- {{name}}
3434

3535
default-extensions:
36-
- TemplateHaskell
3736
- RecordWildCards
3837
- OverloadedLists
3938
- OverloadedStrings
@@ -73,6 +72,9 @@ handler person context =
7372
return (Left "A person's age must be positive")
7473

7574
{-# START_FILE app/Main.hs #-}
75+
{-# LANGUAGE TemplateHaskell #-}
76+
{-# LANGUAGE ScopedTypeVariables #-}
77+
7678
module Main where
7779

7880
import Aws.Lambda

0 commit comments

Comments
 (0)