Here is a list of libraries or tools that I use. The list is written using a template in Artyom's blog.
I hope to update the list weekly and publish updates monthly.
Area | What and why |
---|---|
Build tools | Nix + cabal Nix + cabal gives me the best user experience so far. Allows easily switch the versions. Freeze versions and have a reproducible built environment on different OS-es. Besides, nix allows to set up the entire developer environment, including tools, external programs, databases, shell scripts. |
Editor | Vim (no plugins) / Idea (no haskell plugins) My editor/environment is far from the one I want to advertise. Even though editors greatly improved in the Haskell ecosystem, I still not ready to invest time into setting up my environment. Just use a simple setup with no plugins; this setup at least does not harm my workflow. It's also easy to use it for work on a remote machine. IntelliJ Idea has great non-Haskell plugins I'm very fond of |
Formatter | None, just none |
Prelude | prelude from base/custom prelude in the project with required reexports Most of the preludes have very opinionated choices I don't want to deal with |
List functions | Data.List + containers + own Data.List.Extra + split I want to highlight here that I find lists very useful data structure, the one that you can write very effective and simple to understand algorithms, just make sure the lists are not materialised too much. |
Records | generic-lensgeneric-lens provides a nice API for accessing fields without extra boilerplate. I addition you can define your own definitions to introduce additional labels for the structures. |
Anonymous records | none. for JSON structures I use aeson-injector , but it's not full-featured anonymous records |
Lenses | lens |
JSON | aeson + lens-aeson I'm not always happy with aeson, but it reasonably does it's job |
YAML | It's just a standard library for YAML, works quite nice, doesn't require anything except declaring |
TOML | tomland A good library with bi-directional parsing support, that can save you when you need both parser and serializer, and they should be compatible. It may be a pain otherwise. I was not convinced that TOML format in way forward format for me in my experiments, so I never had a too deep look. |
Configuration | yaml + environment variables For configuration, I usually use YAML files, and more often environment files. Env works great in combination with external tooling. Experiments with TOML files didn't show measurable benefit over YAML files |
Filepath | directory, filepath |
File manipulation and scripting | typed-process process library has some quirks, so if you try to implement the nice and simple solution you'll reimplement typed-process, so it's easier to use it. |
Command-line arguments | optparse-applicative you may use optparse-generic as a quick start but quite soon you'll need the full set of optparse-applicative features. |
Streaming | streaming, conduit I love streaming for simplicity, but sometimes there are too many conduit based libraries around, so it's easier to use that |
HTML generation | blaze-html (historically)I don't remember any good reason for not moving to lucid, for example, but blaze-HTML works for me |
Serving | servant + servant-generic Looks like a standard and is head and shoulders over its competitors. Sometimes when I don't need the full power of servant I use wai directly |
HTTP requests | http-client -> http-conduit I used the lowest-level libraries because they work, and you never try to overcome the obstacles introduced by the "safer" API interfaces. Besides I've experimented a bit on wreq It fits 95% use cases, so can suggest that as a starter, but I'm not ready for the shift in my projects. |
Downloading files | http-client with streaming |
PostgreSQL | hasql A great library that uses raw SQL and doesn't try to introduce features that do not work well. |
logging | cheops-logger ( co-log-concurrent + co-log-json + co-log-core ) Do not puzzle with co-log; it's a combination of libraries that allow you to dump structured logs in a JSON format |
map | containers , rarely unordered-containers (historically) |
crypto | cryptonite |
tests | tasty |
benchmarking | criterion (historically) |
parsing | attoparsec, slowly shifting to megaparsec |
regexes | regex |
concurrency | async, raw STM |
reflection | reflection |
randomness | random>1.12; tf-random |
S3 compatible storage | minio-hs A nice library that works (usually) |
telegram API | telegram-bot-simple |
metrics | My fork of prometheus with prometheus-extra Prometheus is almost a standard and can be easily integrated with external tooling. The extra package provides some new primitives with some more effective and others that provide useful statistics. |
CSV handing | cassava Pretty fast library with an easy to use API. |
resource handing | resourcet , resource-pool |
Effects handing | handle pattern + transformers |
zip files handling | zip (sometimes typed-process + zip/unzip system packages). |
vectors handling | vector and vector-algorithms |
error handling and validation | monad-chronicle |
JWT manipulation | jose, + own wrappers that allow operating on unverified jwt |
LRU | lru-caching |
time-based caching | lazy-cache |
time library | ??? (clock, thyme, time) problems everywhere... |
Redis client | hedis standard de-facto, questionable API, but it works |
templating | ede - a nice powerful and extensible templating engine, introduces its own template language Dedicated post about ED-E package. |
environment parser | own, but can suggest trying envy |
base64 | base64 an efficient library that works for many byte and text types |
HaskellNet for sending emails email-validate — for address validation |
2021-01-02: Initial layout
2021-01-10: add base64
2021-01-17: add HaskellNet and email-validate