This repository contains a preconfigured Haskell development environment, allowing you to start coding in Haskell with zero installation using Gitpod and a browser-based version of VS Code.
The environment contains a skeleton for a simple Haskell project, designed as a starter for the solo project of EMURGO Academy's Haskell course.
- Fork this repository
- Copy the link to your new repository and prefix it with "https://gitpod.io/#" in your browser
- Click
Continue with GitHub
andAuthorize gitpod-io
- Wait for the environment to build. This can take a while the first time.
- Select "VS Code Browser" as your editor.
This template contains a basic structure for a simple Haskell project. Add your project code to the empty *.hs
files:
src/Lib.hs
: this module is intended to contain the core business logic of your program - it should consist of pure functions (not IO actions). You can rename this or create additional modules as needed (be sure to adjust theother-modules
section ofemurgo-project.cabal
to reflect any changes/additions)src/Types.hs
: use this module to define any custom types and synonyms that you'll use in other modulessrc/Actions.hs
: this module should contain helper IO actions that will be used inside themain
action ofapp/Main.hs
. Most of your effectful code should live in this module.app/Main.hs
: compose a minimalmain
action using helper actions defined insrc/Actions.hs
to run your application (this is what will be used if you )
Add any additional packages you need for your project below base
in the build-depends
section of emurgo-project.cabal
. Follow instructions if you encounter any errors due to a "hidden package": these refer to packages that are part of the standard library but aren't imported into a Haskell project by default. The editor tooling will identify the name of the package you need to add to build-depends
in such cases.
Use cabal repl
in the terminal and the :l
command followed by a specific module name (Lib
, Types
, Actions
, etc.) to test your code.
Use cabal run
to run your completed program.
As you complete the assignments, stage, commit and push your changes to Github using the Source Control
tab in the left panel.