Skip to content

Commit f7ca316

Browse files
committed
Stylistic changes
1 parent 3570207 commit f7ca316

File tree

8 files changed

+13
-36
lines changed

8 files changed

+13
-36
lines changed

ChangeLog.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2018 The Agile Monkeys
1+
Copyright 2019 The Agile Monkeys
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

Makefile

Lines changed: 0 additions & 11 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This package provides a way of running Haskell projects on AWS Lambda.
99
## Sample lambda function
1010

1111
```
12-
stack new my-haskell-lambda https://github.com/theam/aws-lambda-haskell-runtime/raw/master/stack-template.hsfiles --resolver=lts-13.0 --omit-packages
12+
stack new my-haskell-lambda https://github.com/theam/aws-lambda-haskell-runtime/raw/master/stack-template.hsfiles --resolver=lts-13.25 --omit-packages
1313
cd my-haskell-lambda
1414
stack docker pull
1515
```
@@ -21,7 +21,7 @@ packages:
2121
- .
2222
2323
extra-deps:
24-
- aws-lambda-haskell-runtime-1.0.10
24+
- aws-lambda-haskell-runtime-2.0.0
2525
```
2626

2727
to your `stack.yaml`
@@ -34,15 +34,6 @@ make
3434

3535
Now you should have a `build/function.zip` file that you can upload to your lambda.
3636

37-
## Lambda function configuration
38-
39-
When creating your lambda function you need to provide a layer with the Haskell runtime. We have deployed the layer to our AWS account, you can use it or deploy it to your own AWS account.
40-
41-
The ARN of the runtime layer is:
42-
```
43-
arn:aws:lambda:<YOUR REGION>:785355572843:layer:aws-haskell-runtime:5
44-
````
45-
4637
## Full user guide
4738

4839
Take a look at the [Getting Started with the Haskell AWS Lambda Runtime](https://medium.com/the-theam-journey/getting-started-with-the-haskell-aws-lambda-runtime-951b2322c7a3) guide.

src/Aws/Lambda/Runtime.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import Data.Aeson
1111
import qualified Data.ByteString.Lazy.Char8 as LazyByteString
1212

1313
import qualified Aws.Lambda.Runtime.ApiInfo as ApiInfo
14+
import qualified Aws.Lambda.Runtime.Common as Runtime
1415
import qualified Aws.Lambda.Runtime.Context as Context
1516
import qualified Aws.Lambda.Runtime.Environment as Environment
1617
import qualified Aws.Lambda.Runtime.Error as Error
1718
import qualified Aws.Lambda.Runtime.Publish as Publish
18-
import qualified Aws.Lambda.Runtime.Common as Runtime
1919

2020
-- | Runs the user @haskell_lambda@ executable and posts back the
2121
-- results. This is called from the layer's @main@ function.

src/Aws/Lambda/Runtime/Common.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ data LambdaOptions = LambdaOptions
2020

2121
-- | Wrapper type to handle the result of the user
2222
newtype LambdaResult =
23-
LambdaResult String
23+
LambdaResult String

src/Aws/Lambda/Runtime/Publish.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import qualified Data.ByteString.Char8 as ByteString
1313
import qualified Network.HTTP.Client as Http
1414

1515
import qualified Aws.Lambda.Runtime.API.Endpoints as Endpoints
16+
import Aws.Lambda.Runtime.Common
1617
import Aws.Lambda.Runtime.Context (Context (..))
1718
import qualified Aws.Lambda.Runtime.Error as Error
18-
import Aws.Lambda.Runtime.Common
1919

2020
-- | Publishes the result back to AWS Lambda
2121
result :: LambdaResult -> String -> Context -> Http.Manager -> IO ()

stack-template.hsfiles

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ description: Please see the README on GitHub at <https://github.com/{{gi
1111

1212
dependencies:
1313
- base >= 4.7 && < 5
14-
- aws-lambda-haskell-runtime >= 1.0.9
14+
- aws-lambda-haskell-runtime >= 2.0.0
1515
- aeson
1616

1717
library:
1818
source-dirs: src
1919

2020
executables:
21-
haskell_lambda:
21+
bootstrap:
2222
main: Main.hs
2323
source-dirs: app
2424
ghc-options:
@@ -43,15 +43,16 @@ all:
4343
@rm -rf ./build/*
4444
@stack clean --docker
4545
@stack build --docker
46-
@cp `stack --docker path --local-install-root`/bin/haskell_lambda build
47-
@cd build && zip function.zip haskell_lambda && rm haskell_lambda && cd ..
46+
@cp `stack --docker path --local-install-root`/bin/bootstrap build
47+
@cd build && zip function.zip bootstrap && rm bootstrap && cd ..
4848
{-# START_FILE src/Lib.hs #-}
4949
module Lib where
5050

5151
import GHC.Generics
52-
import Aws.Lambda.Runtime
5352
import Data.Aeson
5453

54+
import Aws.Lambda
55+
5556
data Person = Person
5657
{ personName :: String
5758
, personAge :: Int
@@ -69,8 +70,7 @@ handler person context =
6970
{-# START_FILE app/Main.hs #-}
7071
module Main where
7172

72-
import Aws.Lambda.Configuration
73-
import Aws.Lambda.Runtime
73+
import Aws.Lambda
7474

7575
import qualified Lib
7676

0 commit comments

Comments
 (0)