{"id":21409874,"url":"https://github.com/stackbuilders/haskell-faas-template","last_synced_at":"2026-01-04T03:05:22.961Z","repository":{"id":38355657,"uuid":"429119051","full_name":"stackbuilders/haskell-faas-template","owner":"stackbuilders","description":"Haskell Faas Template","archived":false,"fork":false,"pushed_at":"2022-06-06T14:48:52.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-23T04:32:43.717Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Roff","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackbuilders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-17T16:24:26.000Z","updated_at":"2022-02-06T02:11:52.000Z","dependencies_parsed_at":"2022-08-25T05:00:59.339Z","dependency_job_id":null,"html_url":"https://github.com/stackbuilders/haskell-faas-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fhaskell-faas-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fhaskell-faas-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fhaskell-faas-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fhaskell-faas-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackbuilders","download_url":"https://codeload.github.com/stackbuilders/haskell-faas-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910688,"owners_count":20367538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T17:34:51.265Z","updated_at":"2026-01-04T03:05:22.935Z","avatar_url":"https://github.com/stackbuilders.png","language":"Roff","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Developing in Haskell\n\nHere you will find a Haskell template to start developing functions working with the HTTP protocol.\n\n## Making a Function\n\nIn order to interact with HTTP protocol, we need to use the `haskell-http` function template:\n\n```\nfaas-cli template pull git@github.com:stackbuilders/haskell-faas-template.git\n```\n\nThis will pull all the templates available in the Stackbuilders repository.\n\nThen, we will create a new haskell function using:\n\n```\nfaas-cli new --lang haskell-http \u003cmy-function\u003e\n```\n\nReplace the `\u003cmy-function\u003e` with a descriptive name for your function.\n\nNow, we will get a description of our project in the `\u003cmy-function\u003e.yml` file. The `\u003cmy-function\u003e` directory contains the necessary resources to implement our \"lambda\" function. It should look like this:\n\n![](img/directory-structure.png)\n\nInside the `\u003cmy-function\u003e` directory we will find:\n\n- `cabal.project`: Here you can import libraries that are not present in [Hackage](https://hackage.haskell.org/) (i.e. custom libraries)\n- `haskell-template-function.cabal`: Here you will import the libraries needed in order to build the function. You can import libraries inside the `build-depends` section like this:\n\n  ![](img/import-libraries.png)\n\n- `src`: In this directory you will find the `Handler.hs`. This is the \"main\" module for your FaaS function. This is the module responsible for taking the input and outputting the response.\n- `test`: Directory with the `HandlerSpec.hs` file. Here you can use the `Hspec` library to write tests for your function.\n\nFor this template we use Scotty as our web framework,we choose it because Scotty is a cheap and cheerful way to write RESTful, declarative web applications. When you want to create a page it is as simple as defining the verb, url pattern, and Text content. Besides, it is template-language agnostic. Anything that returns a Text value will do. And, it Uses very fast Warp web server by default.\n\n### Note:\n\nWe have used an oficial image from Docker to create a personalized one to harbor the needed precompiled dependencies. It is possible to visualize it at the next repository: [https://github.com/stackbuilders/haskell-faas-template]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbuilders%2Fhaskell-faas-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackbuilders%2Fhaskell-faas-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbuilders%2Fhaskell-faas-template/lists"}