semantic is compiled with the ghc compiler and built/packaged with cabal. It uses Cabal's Nix-style local builds and uses dependencies from Hackage. We recommend using ghcup to sandbox your installation of GHC.
| Tool | Explanation |
|---|---|
ghc |
The Glasgow Haskell Compiler is the open source compiler and interactive environment for the Haskell programming language. |
cabal |
Cabal is a system for building and packaging Haskell libraries and programs. It is similar to having make files instead of having to type several complicated calls to ghc to compile and link a project. |
hackage |
Hackage is the most widely used package archive of open source libraries and programs. cabal-install is used to download and install packages. |
ghcup |
ghcup takes care of managing different versions of GHC on your system. We aggressively track new versions of GHC; sandboxing makes upgrading to new versions safe and easy. |
ghci |
ghci is GHC's interactive environment. This is where Haskell expressions can be interactively evaluated and programs can be interpreted. |
semantic is a complicated app with a very large dependency tree. Because managing large dependency trees in a system-wide ghc installation is difficult, especially when developing on multiple Haskell projects, cabal enables "local" builds: each dependency is linked in per-project, not globally. In practice, this means that you should prefix your commands with the new- prefix: cabal new-build builds the project, new-clean purges its build artifacts, etc. (With versions of the cabal command line tool newer than 2.6, local builds become the default, with the v1- prefix required to yield old behavior.)
Running cabal new-repl semantic:lib will boot a GHCi with the right environment for Semantic set up.
See the 💡ProTips for more info.
You may want to customize Atom to support your haskelling:
- Install Haskell-specific packages:
language-haskellprovides syntax highlighting for.hs,.cabal, and other Haskell files.stylish-haskellcan be used viaatom-beautifyfor source code formatting.align-regexpis convenient for aligning blocks of text by some pattern.- Either
ide-haskell-hieoride-haskell:ide-haskell-hieusesatom-ide-uiandhaskell-ide-engine(instructions below) to provide linting, errors, warnings, types on hover, autocompletion, etc.git clone https://github.com/haskell/haskell-ide-engine.gitsomewhere convenient andcdinto it.- Run
maketo build and installghc-specific versions ofhieinto~/.local/bin. This will allow you to usehiewith projects using different versions ofghc(currently 8.0.2, 8.2.1, and 8.2.2). Alternatively,stack installwill build with the current supported version ofghc(8.2.2 at time of writing) and copy it to~/.local/bin/hie. - Make sure that
~/.local/bin/is on yourPATH. - If you went with the
ghc-specific install route (make), then configureide-haskell-hieto “Use the hie-wrapper”:
.
ide-haskellalso provides errors, warnings, types, etc. usingghc-modand other tools:stack install ghc-mod hlint happy— this installsghc-modandhlintexecutables on your system required for thehaskell-ghc-modAtom package below.- Install
haskell-ghc-mod, andide-haskell-cabal - If you don't launch Atom from your shell, set the additional paths for the the
haskell-ghc-modpackage in Atom to include/Users/$USER/.local/bin/and/usr/local/bin. This is done by going toAtom -> Preferences -> Packages -> haskell-ghc-mod -> Settingsand editing "Additional Paths":
autocomplete-haskell: Autocompletionide-haskell-hasktags: Symbols
- Install a font with ligatures (this will require per-font configuration):
- Find Documentation
- For the most part our dependencies have documentation on hackage. You can find individual packages there.
- Hayoo and Hoogle can search package documentation on hackage by package name, symbol name, and even symbol type.
- Dash can install documentation from hackage, search by API, and integrations exist for Atom, emacs, and other tools.
See 💡ProTip!.md for more.
