Recently, after several failed attemps, I decided to commit to learning Haskell.
For those who don’t know what Haskell is (run), here’s the Wikipedia definition:
Haskell /ˈhæskəl/ is a standardized, general-purpose compiled purely functional programming language, with non-strict semantics and strong static typing.
Haskell is seen by many functional programmers as THE functional programming language, and for now (maybe I’ll be disillusioned someday) I’m one of them.
This short blog post presents the small work environment I’m using and which fits my current needs (which are mostly doing exercises and toy projects).
I know that it probably won’t be suitable for big projects, but if that is your need, you’re not the target here ;).
Let’s start here.
Download the and install the Haskell Platform (bottom of the page) for your OS, which is an all in one bundle.
You will get:
It comes with the Haskell Platform you downloaded.
ghciat your project’s root) and run the functions you have in scope
:rin the REPL) and calling them
:tand the name of a function (
:t map) to get back the type of it (
map :: (a -> b) -> List a -> List b)
:iand the name of a function or data type to get infos on it
Get it here.
Get it here.
I chose to work on VS Code because it seems to have pretty good Haskell extensions and it is fast and light (especially coming from IntelliJ…)
Haskell Syntax Highlight (self explanatory)
(a -> b) -> [a] -> [b](here) and Hoogle gives you back the list of functions that match or almost match your request
After having installed everything:
ghcid "--command=ghci"which starts GHCid
ghciwhich will open a REPL in the context of your project (in that one you’ll have to
:rto try the functions that you write)
That’s a small but good enough setup for me now.
I’ll try to update my post if I find new interesting stuff to add to that setup. Feel free to contact me if anything needs to be corrected or if you feel so :).
Happy Haskelling !
Edit: I felt like Haskell Language Server was taking a lot of memory and… indeed it does. I hope it’s gonna be fixed soon, in the meantime, you can desactivate and reactivate it in your VS Code extensions when it gets too greedy…tags: Haskell