Motivation
At Scarf we love highlighting and using awesome open source projects. This blog post will talk about Relude, a project we use in the majority of our Scarf tech stack. For more information on the overall architecture we use to develop Scarf see our previous Scarf Tech Stack post.
What is Relude?
At Scarf we write functional programming in Haskell. Relude is one alternative to Prelude, a standard module, in Haskell. It is widely known as a safe, performant, and user-friendly Haskell standard library.
Their ReadMe details all the reasons why other developers might choose Relude for their tech stack. In this post we will talk about why and how Scarf uses it.
Why Relude?
Using and adopting a new library can be difficult. Often projects lack proper documentation. Fortunately, Relude has extensive documentation that is beginner friendly.
The Relude community is also inviting and works to keep good communication between their maintainers and users.
The community put a lot of effort into their content, including helpful blog posts by the maintainers on their site, Kowainik.
Other reasons we use Relude include:
- The library offers type-safety and function totality.
- It is performant with a preference for {% c-line %}Text{% c-line-end %}, a more efficient alternative to Haskell's standard {% c-line %}String{% c-line-end %}.
- It provides convenience by bringing commonly used types and functions into scope, and making available functions easier to use.
- It is minimal with a low number of dependencies.
How Scarf uses Relude
Relude is used in a majority of our codebase, including the main app server we use for our website, `scarf-server`, our data processing pipeline, and beyond.
We made the decision to use Relude as our base library instead of the default Haskell base library because it has good defaults that cue users when they are using unsafe functions. This is important because the default library doesn’t flag the unsafe functions which can lead to runtime errors.
Learn More
To learn more about Relude:
- Kowaink: https://kowainik.github.io/posts
- Twitter: https://twitter.com/kowainik
- Relude GitHub: https://github.com/kowainik/relude
Do you know what companies are using your open source project? Learn more about how Scarf can help you see a project’s impact, identify potential customers, and understand growth without sacrificing your end-user’s privacy:
- Website: https://about.scarf.sh/
- Tech stack blog post: https://about.scarf.sh/post/the-scarf-tech-stack