From dbb975afbb84307bdf3b5f79abe17afa9603f2da Mon Sep 17 00:00:00 2001 From: Luis Morillo Date: Fri, 5 Aug 2022 16:38:32 +0200 Subject: [PATCH 01/11] add start-coding markdown --- site/start-coding.markdown | 65 ++++++++++++++++++++++++++++++++++++++ site/templates/nav.html | 1 + 2 files changed, 66 insertions(+) create mode 100644 site/start-coding.markdown diff --git a/site/start-coding.markdown b/site/start-coding.markdown new file mode 100644 index 00000000..8897f8ec --- /dev/null +++ b/site/start-coding.markdown @@ -0,0 +1,65 @@ +--- +title: Start Coding now +page: start-coding +isSetUp: true +--- + +## Set up a local development environment in three steps + +A Haskell development environment consist in: + +- a compiler (`ghc`) +- a language server (`hls`) +- a building tool (`cabal` and/or `stack`) +- an editor compatible with the language server protocol. + +It is recommended to use `ghcup` to manage your haskell toolchain and `vscode` as your editor. + +- **Step 1**: Install [GHCup](https://www.haskell.org/ghcup/). You'll be prompted to install some tools: Install `hls` and optionally `stack`. (`stack` users should [configure it properly](https://docs.haskellstack.org/en/stable/Stack_and_VS_Code/#workaround-1)). +- **Step 2**: Install [vscode](https://code.visualstudio.com/). For integration with other editors see `hls` [documentation](https://haskell-language-server.readthedocs.io/en/latest/configuration.html#configuring-your-editor) +- **Step 3**: Open `vscode` and install the [haskell extension](https://marketplace.visualstudio.com/items?itemName=haskell.haskell) either using the extension panel or pressing CTRL+P and `ext install haskell.haskell`. + +## Try without installing Haskell + +If you don't want to install the Haskell toolchain locally, you have a ready-to-use environment in Gitpod. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/gitpod-io/template-haskell) + +## Integration with stack + +`stack` can integrate easily with `haskell-language-server`. You need to configure `stack` so it doesn't install `ghc` on its own. + +- First, _You still need to install ghc, cabal and hls via ghcup_, so read the first step in this guide. This is particulary important if you already had stack installed before. +- Configure `stack` to use system's `ghc`. Configuration can be either _global_ (recomended) or _local_ + - Global (recomended) + + ```bash + # Run on a terminal if you want to set a global configuration + stack config set install-ghc --global false + stack config set system-ghc --global true + ``` + + - Local: + + ```bash + # On stack.yaml add this line if you want to set a local configuration + system-ghc: true + ``` + +- You _must_ use a `stackage` snapshot compatible with the `ghc` version installed by `ghcup`. Visit [stackage](https://www.stackage.org/) to get the `ghc` version on each snapshot. For example `lts-18.28` uses `ghc-8.10.7`. You can check version compatibility with: + + ```bash + # This prints the ghc's version installed and used by ghcup + > ghcup list -c installed -t ghc + ✔✔ ghc 8.10.7 recommended,base-4.14.3.0 hls-powered + + # Your resolver should point to 18.28 --------------------------------------------------- + > cat stack.yaml # vvvvv + resolver: + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/28.yaml + + ``` + +It is recommended to read `stack`'s user guide [on this topic](https://docs.haskellstack.org/en/stable/Stack_and_VS_Code/) + +In case you need to use a different snapshot you have to install it's `ghc` version with `ghcup`. For the sake of example, let's say you are using `lts-16.31`, which uses `ghc-8.8.4`. Then you need to run `ghcup install ghc 8.8.4` on a terminal. Also, depending on which snapshot you are using, you might loose integration with `hls`. Check `hls` [documentation](https://haskell-language-server.readthedocs.io/en/latest/supported-versions.html) for more info. diff --git a/site/templates/nav.html b/site/templates/nav.html index 21176087..19c80c9e 100644 --- a/site/templates/nav.html +++ b/site/templates/nav.html @@ -12,6 +12,7 @@
  • Community
  • Documentation
  • Donate
  • +
  • Start Coding now
  • From 7213469375a9a8f8b379f89652b4b92c68db05d3 Mon Sep 17 00:00:00 2001 From: Luis Morillo Date: Fri, 5 Aug 2022 16:39:54 +0200 Subject: [PATCH 02/11] delete stack integration for reference to stack's configuration --- site/start-coding.markdown | 39 -------------------------------------- 1 file changed, 39 deletions(-) diff --git a/site/start-coding.markdown b/site/start-coding.markdown index 8897f8ec..1bc02078 100644 --- a/site/start-coding.markdown +++ b/site/start-coding.markdown @@ -24,42 +24,3 @@ It is recommended to use `ghcup` to manage your haskell toolchain and `vscode` a If you don't want to install the Haskell toolchain locally, you have a ready-to-use environment in Gitpod. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/gitpod-io/template-haskell) - -## Integration with stack - -`stack` can integrate easily with `haskell-language-server`. You need to configure `stack` so it doesn't install `ghc` on its own. - -- First, _You still need to install ghc, cabal and hls via ghcup_, so read the first step in this guide. This is particulary important if you already had stack installed before. -- Configure `stack` to use system's `ghc`. Configuration can be either _global_ (recomended) or _local_ - - Global (recomended) - - ```bash - # Run on a terminal if you want to set a global configuration - stack config set install-ghc --global false - stack config set system-ghc --global true - ``` - - - Local: - - ```bash - # On stack.yaml add this line if you want to set a local configuration - system-ghc: true - ``` - -- You _must_ use a `stackage` snapshot compatible with the `ghc` version installed by `ghcup`. Visit [stackage](https://www.stackage.org/) to get the `ghc` version on each snapshot. For example `lts-18.28` uses `ghc-8.10.7`. You can check version compatibility with: - - ```bash - # This prints the ghc's version installed and used by ghcup - > ghcup list -c installed -t ghc - ✔✔ ghc 8.10.7 recommended,base-4.14.3.0 hls-powered - - # Your resolver should point to 18.28 --------------------------------------------------- - > cat stack.yaml # vvvvv - resolver: - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/28.yaml - - ``` - -It is recommended to read `stack`'s user guide [on this topic](https://docs.haskellstack.org/en/stable/Stack_and_VS_Code/) - -In case you need to use a different snapshot you have to install it's `ghc` version with `ghcup`. For the sake of example, let's say you are using `lts-16.31`, which uses `ghc-8.8.4`. Then you need to run `ghcup install ghc 8.8.4` on a terminal. Also, depending on which snapshot you are using, you might loose integration with `hls`. Check `hls` [documentation](https://haskell-language-server.readthedocs.io/en/latest/supported-versions.html) for more info. From 6b918c0eb61ef4a36bdcdc27e484070501cc0377 Mon Sep 17 00:00:00 2001 From: Luis Morillo Date: Fri, 5 Aug 2022 16:43:44 +0200 Subject: [PATCH 03/11] shorter header --- site/start-coding.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/start-coding.markdown b/site/start-coding.markdown index 1bc02078..97b5cc55 100644 --- a/site/start-coding.markdown +++ b/site/start-coding.markdown @@ -4,7 +4,7 @@ page: start-coding isSetUp: true --- -## Set up a local development environment in three steps +## Install development environment in three steps A Haskell development environment consist in: From df2cbc1b8e4a387395e593ddfd214891b45db523 Mon Sep 17 00:00:00 2001 From: Luis Morillo Date: Fri, 5 Aug 2022 16:43:56 +0200 Subject: [PATCH 04/11] typo --- site/start-coding.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/start-coding.markdown b/site/start-coding.markdown index 97b5cc55..fa7f5eed 100644 --- a/site/start-coding.markdown +++ b/site/start-coding.markdown @@ -4,7 +4,7 @@ page: start-coding isSetUp: true --- -## Install development environment in three steps +## Install a development environment in three steps A Haskell development environment consist in: From b04e1399b9a459564976cba38f40963b6eb4d03a Mon Sep 17 00:00:00 2001 From: Luis Morillo Date: Mon, 5 Sep 2022 12:02:02 +0200 Subject: [PATCH 05/11] change link position to first --- site/templates/nav.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/templates/nav.html b/site/templates/nav.html index 19c80c9e..4d75920e 100644 --- a/site/templates/nav.html +++ b/site/templates/nav.html @@ -8,11 +8,11 @@ From 623f121ad6ac3f2ba4bd8ec3e1baa31963dc3966 Mon Sep 17 00:00:00 2001 From: lsmor <58398442+lsmor@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:32:32 +0200 Subject: [PATCH 06/11] Update site/start-coding.markdown Co-authored-by: tomjaguarpaw --- site/start-coding.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/start-coding.markdown b/site/start-coding.markdown index fa7f5eed..5b2bf50f 100644 --- a/site/start-coding.markdown +++ b/site/start-coding.markdown @@ -6,7 +6,7 @@ isSetUp: true ## Install a development environment in three steps -A Haskell development environment consist in: +A Haskell development environment consists of: - a compiler (`ghc`) - a language server (`hls`) From 29ad99a934766e42c2197ab8ace59c0491d6a5e2 Mon Sep 17 00:00:00 2001 From: lsmor <58398442+lsmor@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:32:47 +0200 Subject: [PATCH 07/11] Update site/start-coding.markdown Co-authored-by: tomjaguarpaw --- site/start-coding.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/start-coding.markdown b/site/start-coding.markdown index 5b2bf50f..ab39b605 100644 --- a/site/start-coding.markdown +++ b/site/start-coding.markdown @@ -10,7 +10,7 @@ A Haskell development environment consists of: - a compiler (`ghc`) - a language server (`hls`) -- a building tool (`cabal` and/or `stack`) +- a build tool (`cabal` and/or `stack`) - an editor compatible with the language server protocol. It is recommended to use `ghcup` to manage your haskell toolchain and `vscode` as your editor. From 471bfea37a5f107d64c97c5df43894c70204bed7 Mon Sep 17 00:00:00 2001 From: Luis Morillo Date: Wed, 7 Sep 2022 17:18:26 +0200 Subject: [PATCH 08/11] added playground and fix typo --- site/start-coding.markdown | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/site/start-coding.markdown b/site/start-coding.markdown index ab39b605..d3b19b13 100644 --- a/site/start-coding.markdown +++ b/site/start-coding.markdown @@ -1,5 +1,5 @@ --- -title: Start Coding now +title: Start Coding Now page: start-coding isSetUp: true --- @@ -21,6 +21,10 @@ It is recommended to use `ghcup` to manage your haskell toolchain and `vscode` a ## Try without installing Haskell -If you don't want to install the Haskell toolchain locally, you have a ready-to-use environment in Gitpod. +If you don't want to install the Haskell toolchain locally, you can: + +- Try it in the [Haskell Playground](https://play-haskell.tomsmeding.com/) + +- Use a complete visual studio code environment in Gitpod. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/gitpod-io/template-haskell) From 260759a141cf287f69b02e82b492a60e54e2e20a Mon Sep 17 00:00:00 2001 From: Luis Morillo Date: Wed, 7 Sep 2022 17:20:38 +0200 Subject: [PATCH 09/11] fix link text --- site/templates/nav.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/templates/nav.html b/site/templates/nav.html index 4d75920e..bde0d83a 100644 --- a/site/templates/nav.html +++ b/site/templates/nav.html @@ -8,7 +8,7 @@