All Projects → simonmichael → haskell-atom-setup

simonmichael / haskell-atom-setup

Licence: other
How to set up and use the Atom IDE for Haskell development in 2016. 2020: Obsolete, use VS Code instead.

Programming Languages

HTML
75241 projects
Makefile
30231 projects

Projects that are alternatives of or similar to haskell-atom-setup

learn-ngrok
☁️ Learn how to use ngrok to share access to a Web App/Site running on your "localhost" with the world!
Stars: ✭ 50 (-39.76%)
Mutual labels:  howto
ServiceNow-GraphQL-Example
Simple example how to use GraphQL in the latest ServiceNow Release: Paris
Stars: ✭ 18 (-78.31%)
Mutual labels:  howto
cheat-sheet
collection of cheat sheets
Stars: ✭ 150 (+80.72%)
Mutual labels:  howto
portablebpf
You came here so you could have a base code to serve you as an example on how to develop a BPF application, compatible to BCC and/or LIBBPF, specially LIBBPF, having the userland part made in C or PYTHON.
Stars: ✭ 32 (-61.45%)
Mutual labels:  howto
mk
LinuxCNC / Machinekit and EtherCAT notes.
Stars: ✭ 50 (-39.76%)
Mutual labels:  howto
SkiPi
Skywire on Raspberry Pi
Stars: ✭ 16 (-80.72%)
Mutual labels:  howto
shell.how
Explain shell commands using next-generation autocomplete Fig.
Stars: ✭ 237 (+185.54%)
Mutual labels:  howto
pfc-howtos
Here you will find all the example code for extensions and tools for the pfc family
Stars: ✭ 31 (-62.65%)
Mutual labels:  howto
tutorials as code
so that stuff read/seen don't get muddled up with time
Stars: ✭ 42 (-49.4%)
Mutual labels:  howto
godot recipes
Lessons, tutorials, and guides for game development using the Godot game engine.
Stars: ✭ 135 (+62.65%)
Mutual labels:  howto
howto
Dumping ground for various HowTo documents that I produce
Stars: ✭ 58 (-30.12%)
Mutual labels:  howto
DEVGUIDE
CalConnect project to provide documentation on Calendaring and related issues.
Stars: ✭ 17 (-79.52%)
Mutual labels:  howto
process-handbook
📗 Contains our processes, questions and journey to creating ateam
Stars: ✭ 70 (-15.66%)
Mutual labels:  howto
ubiquiti-edge-router-lite-openbsd-osx
Install OpenBSD on your Ubiquiti Edge Router Lite 3 from MacOS (OSX)
Stars: ✭ 23 (-72.29%)
Mutual labels:  howto
howto
Terminal client for stack overflow
Stars: ✭ 25 (-69.88%)
Mutual labels:  howto
SolderingTutorial
Complete soldering course for beginners and advanced.
Stars: ✭ 104 (+25.3%)
Mutual labels:  howto
fix-linux-mouse
Hints how to fix USB mouse issues on Linux
Stars: ✭ 36 (-56.63%)
Mutual labels:  howto
3dsMax-Python-HowTos
3ds Max python samples
Stars: ✭ 86 (+3.61%)
Mutual labels:  howto
firejailed-tor-browser
HOWTO: Firejailed Tor Browser
Stars: ✭ 18 (-78.31%)
Mutual labels:  howto
aws-cpp-developer-guide
Content for the AWS SDK for C++ Developer Guide. For more info about the AWS C++ SDK, go to http://github.com/aws/aws-sdk-cpp
Stars: ✭ 19 (-77.11%)
Mutual labels:  howto

[2020: obsolete, use VS Code instead]

Haskell Atom Setup 2016

What is the least painful way to get Haskell and a modern, user-friendly development environment set up ? Based on my periodic attempts to set up the available Haskell IDEs, and to support newcomers on IRC, as of early 2016 it's stack and Atom (unless you're on a mac and willing to pay and be in a slightly walled garden, in which case it's Haskell for Mac).

Here are some basic recipes for setting up Haskell and Atom from scratch, on any of the major platforms, as reliably and easily as possible. They briefly note the steps required, and also the results you can expect (something that's often unclear with Haskell IDEs). You don't need any previous Haskell knowledge, but you will need to download things, run terminal commands, wait for builds, edit files and configure settings. With a fast connection/machine and the hints below, it should take less than half an hour, most of that unattended.

This doc can evolve if you test it yourself and send pull requests (quick feedback via IRC is also welcome). Note as of late 2016 I have moved from Atom to Intellij (similar features, more refined and robust) and I've stopped updating this doc myself.

If it is obsolete or there's a much better place for it, let me know. I hope you find it useful.

Url: https://github.com/simonmichael/haskell-atom-setup
Created: 2016/5/12 by Simon Michael (email:[email protected], freenode:sm)
Updated:     2016/12/26
Discussion:  #haskell, issues, haskell-cafe list

Table of Contents

Set up Haskell

  1. Install Stack, (Haskell build tool): http://haskell-lang.org/get-started
  2. Add Stack's bin directory to your PATH if possible.
  • Eg: echo 'export PATH=\$HOME/.local/bin:\$PATH' >> ~/.bashrc
  1. Install a default instance of GHC (Haskell compiler) for your user:
  • stack setup

Create a minimal program in terminal (Optional)

in a terminal/command/shell window:

echo 'main = putStrLn "hello world"' > hello.hs
stack ghc hello.hs  # compile the program
./hello             # run it

Test your program interactively in terminal (Optional)

stack ghci
:load hello.hs
:main    # or any Haskell expression
:reload  # after changing hello.hs
:help
:quit

Set up Atom

  1. install tools: stack install ghc-mod hlint stylish-haskell # slow

  2. install Atom (text editor & IDE): http://atom.io

  3. start Atom

  4. install plugins: Atom Preferences -> Install

    • search for haskell

      • install language-haskell, ide-haskell, ide-haskell-repl and haskell-ghc-mod
    • search for term3

      • install term3
  5. configure plugins: Atom Preferences -> Packagages

  • ide-haskell
    • nothing ?
  • ide-haskell-repl
    • Command Args: ghci
    • Command Path: stack # or the stack executable's absolute path, eg /usr/local/bin/stack. Don't use ~.
  • haskell-ghc-mod
    • Additional Path Directories: ... # eg on mac: /Users/USERNAME/.local/bin, /usr/local/bin

View your program in Atom

  1. File -> Open, select hello.hs (or other file you like)
  2. Haskell IDE -> Toggle Panel hides/shows Error/Warning/Lint/... panes

With an module open, you should see:

  • Syntax or type errors highlighted in place and reported in the Error pane
  • Hhlint cleanup suggestions highlighted in place and reported in the Lint pane
  • Auto-completion when typing both Haskell keywords (module, let, etc) and local names

Troubleshooting

  • Haskell IDE -> Prettify gives an error:

    • stylish-haskell may not be in your path if Atom was started from GUI. Try starting from terminal (on mac: open -a Atom)
    • The file parsing failed due to, for example, misplaced code
  • if Haskell IDE -> Prettify does nothing, chances are it is already prettified

Test your program interactively in Atom

While viewing hello.hs, do Haskell IDE -> Open REPL and after you should see a new pane with a \*Main> prompt.

Enter GHCI commands here using CTRL-enter or CMD-enter:

:main # or any Haskell expression
:reload # after saving changes in hello.hs
:help
:quit

Run terminal commands in Atom

You can also run regular GHCI in a terminal pane:

Packages -> Term 3 -> Open New Terminal In Right Pane (eg)

Create a program, package and project

  • In the terminal: stack new hello simple
  • In Atom: File -> Open, select and open the hello directory (with no file selected)

You should see:, in the sidebar:

.stack-work  
src/  
  Main.hs     # new program, similar to hello.hs. Click to open it  
hello.cabal   # package & program properties  
LICENSE  
Setup.hs  
stack.yaml    # project properties

Build/run/install your package

In the terminal:

cd hello             # enter the project directory (if necessary)
stack build          # build this project's program(s)
stack exec -- hello  # run this project's hello program in place
stack install        # install the hello program in ~/.local/bin
(%USERPROFILE%\.local\bin on Windows)
cd; hello            # runs the installed hello program, if your PATH is set right (see setup)

More on Atom's Haskell support

  • If errors are not highlighted in open files on starting Atom
  • If errors are reported but the file compiles without error at the command line
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].