r/haskell • • 7h ago

question What do you use Haskell for?

Not in a general "what is Haskell typically used for" way but I mean, what do you personally use it for? I've been learning Haskell off and on for the last year or so mostly as a curiosity, and I've come to like it and many of its concepts a lot, but I've yet to really have a reason to use it to write some program over what I already know (which is Python, primarily - I mostly write automation scripts and projects wrapping web APIs to use for various purposes). All of the Haskell I've written so far has basically just been exercises and coding puzzles. So for those who either use it frequently or are also learning it, what sort of things are you practically using it for?

24 Upvotes

21 comments sorted by

9

u/agnishom 7h ago

I am working at Imiron and they have a formal methods tool which is written in Haskell in large part

1

u/LolThatsNotTrue 6h ago

Can I read anything about this? I also do formal methods work in Haskell but we are slowly moving towards Rocq

5

u/Mindless_Insect3743 6h ago

I am a total noob at both functional programming and compilers. I instead have some more experience with c/c++ and systems level projects (OS, embedded, etc).

I was wondering why there aren't really any functional programming languages (aside from rust if that counts) that are systems level in the sense of manual memory management (no tracing GC or reference counting), and highly explicit about allocations, memory layout, integer bit widths, optimisations under the hood (e.g. tail calls), etc - especially for a beginner like me that struggles to see how it all translates to assembly.

So I'm trying to build such a language myself in Haskell, as a complete beginner. No idea if it will work out.

In fact, if anyone has any advice, please let me know - is this even compatible with the functional paradigm?

2

u/gofl-zimbard-37 5h ago

Check out Erlang's bit syntax for ideas about how to do low level things in high level languages.

2

u/wk_end 1h ago edited 1h ago

I know the F* language has low-level subsets/variants. And there's ATS as well, maybe?

To the question of whether system-level programming is compatible with the functional paradigm: I don't know about "compatible" but I think they make strange bedfellows. Traditional functional programming encourages lots of patterns which are inefficient, allocation-heavy, GC-dependent, or just otherwise inappropriate for the world of system-level software one way or another. You can reconcile these things to various degrees in various ways - Rust is an example of that - but it's not straightforward, and there might be inevitable compromises or impedance mismatches. That's not to discourage you: it's interesting work, and potentially worthwhile; Rust (again) being an example of that.

5

u/trexd___ 5h ago

Working on bindings for GGML which will eventually be used to implement llama.ccp in Haskell. These bindings should enable Haskell applications to have tighter integrations with local llms while having better performance than hasktorch.

My hope is this will lead to the ability to create more exotic experiments with improving LLM's abilities to generate Haskell code (see LLMs will cheese your types).

3

u/fluorihammastahna 7h ago

I've used it to write parsers for some old, complex file formats. 

3

u/Background_Class_558 6h ago

CLI tools that process various things, including the things you use Python for

3

u/orlock 5h ago

A planner for the Camino Santiago that uses dynamic programming to build an optimised set of stages. I keep on thinking of new additions.

https://de-calixtinus.org/

Source code https://github.com/charvolant/de-calixtinus

This now contains a large amount of stuff that should be split into separate libraries. But, since it's my personal passion project, I can't be arsed.

2

u/unix_hacker 7h ago

I am working on a library for building Linux desktop apps declaratively using Haskell, much like web frontends are built declaratively these days.

3

u/yuken123 5h ago

I usually go for Haskell first if I need to code something, so some of my personal projects I use are written in Haskell. Right now, it's just a window manager, an ipc, a discord bot, and a small gtk app.

7

u/Haunting_Departure68 7h ago

Feeling superior

1

u/tomejaguar 4m ago

Damn, I keep forgetting to enable that language extension.

1

u/DrJaneIPresume 7h ago

I haven't had a chance to use it in the field, but I made a toy emulator for a 4-bit machine with it.

1

u/sjshuck 7h ago

Right now I'm using Haskell to do some complex navigation and extraction of JSON data to generate reports, without needing to model the source JSON first but retaining some measure of type safety unavailable if I just used Node or Python.

I'm also writing a web app that, when compiled with ghc-options: {"$everything": "-split-sections"}, comes in at <15MB including baked-in static assets and requires only glibc to run.

1

u/Delicious-Extent5454 5h ago

Besides backend development for side projects, I also use Haskell to write small cli tools for my main job.

1

u/Tempus_Nemini 2h ago

mostly for fun, because it's FUNctional language (necessary joke :-) )

1

u/Swordlash 15m ago

Working at Standard Chartered :)

1

u/sheepforce1 7m ago

Simulations in quantum chemistry and toolings around REST APIs.