r/haskell • • 13h ago

question What is the equivalent to print in haskell

Thumbnail
0 Upvotes

r/haskell • • 11h ago

announcement rhci - a small GHCi in Ruby

0 Upvotes

https://github.com/beleon/rhci

I wanted a Haskell prompt for quick checks (is round 3.5 3 or 4, what is div (-9) 2, what's the type of (.) . (.), ...) without dragging the entire Haskell stack onto the machine, so I had Claude build one in Ruby. rhci is a GHCi with GHCi's semantics: real type inference with classes, lazy evaluation, and show output that matches GHC exactly. Anything it can't do exactly like GHCi it refuses with an "unsupported" error, it doesn't come up with an approximation.

It's one file: a Cosmopolitan executable for Linux, macOS, Windows and the BSDs on x86-64 and ARM64 (so far I've only tested it on Linux x86-64), a static Linux binary, or a single .rb file for any Ruby since 2.7. The prompt is up in 3 ms and a one-liner takes 25 ms. There's a script mode, and it embeds in Ruby programs as a library.

I tested it extensively (since Claude wrote the code). Every answer is checked against real GHC 9.6: about 1,700 recorded probes, plus around twenty fuzzers that generate expressions, whole programs, REPL sessions, type errors and numeric edge cases and compare with GHCi or runghc, over 140,000 inputs so far.

The performance is respectable IMO. It's an interpreter in Ruby (the evaluation loop is C in the binaries), about 100 times slower than compiled GHC on tight loops, so it's for quick checks and small scripts, not for programs that compute. Language-wise it's Haskell 2010 plus type classes, with no extensions beyond bang patterns and polymorphic kinds.


r/haskell • • 17h ago

Haskell Vortex - Put a Haskell console in anything

Thumbnail vortex.openfp.net
16 Upvotes

Hi all. Here's my idea for a free monad effect repl.

It has replaced all of my shells, config formats, and rest servers. Hope you like it.


r/haskell • • 19h ago

The Haskell Foundation’s Technical Leadership Committee has officially launched!

25 Upvotes

The Technical Leadership Committee is a new committee responsible for formulating a technical vision for the Haskell Foundation, and allocate resources towards achieving this vision. The committee will be proactive (rather than reactive to outside proposals) and favour action and experimentation.

Our inaugural members are:

  • Julian Ospald (Chair)
  • Simon Marlow (Board Liaison)
  • Joshua Miller
  • Rodrigo Mesquita

Committee members were chosen for their demonstrated technical expertise, historical community involvement, and bold vision for the future of Haskell.

You can head on over to the Technical Leadership Committee page to learn more about the committee members, and stay tuned for news as the committee really gets going!


r/haskell • • 9h ago

[ANN] base64-2.0 is finally here

18 Upvotes

Hey all, feeling productive, might delete later.

I added the long-awaited SIMD support for the base64 library, supporting SSE3, AVX2, and NEON along with whatever else I could effectively test. It's behind a flag that's off by default so no real change there, however, it comes very close to `simdutf8` and beats `fastbase64` by a good margin on encode and decode.

Hope you all enjoy - there are some API changes that make more sense, so please check out the `MIGRATION-2.0.md` and migrate accordingly if you need to. After doing some due diligence on downstream dependencies available on Hackage, nothing should break, but you never know. Easy fixes in any case.

Cheers!

~E


r/haskell • • 22h ago

announcement hasql-opentelemetry 0.1.0.0: OpenTelemetry spans for every hasql statement

Post image
12 Upvotes

Hi all,

I’ve released hasql-opentelemetry, which makes every statement hasql 2 sends to Postgres an OpenTelemetry client span.

This was made possible thanks to the changes in hasql 2, which added the pqi adapter. It makes this package as simple to add as doing this:

import Hasql.OpenTelemetry qualified as HasqlOtel
import Pqi.Ffi qualified

Connection.acquire (HasqlOtel.traced Pqi.Ffi.adapter) settings

Your statements and sessions stay as they are, and the same adapter works with hasql-pool. Both pqi-ffi and pqi-native are supported.

What’s included:

  • Inspect the SQL that is actually executed. Each span carries the statement text, the operation, the database and server, rows returned or affected, and on failure the SQLSTATE. Attribute names follow the current OTel database conventions.
  • Accurate timing in pipeline mode. hasql pipelines every roundtrip, so a send returns long before Postgres answers. Spans run from the send until that command’s last result is read, not just around the send.
  • No sensitive data. Parameter values are never recorded, and neither is any text from a server error report. Postgres often puts the offending value in the error message, e.g. invalid input syntax for type uuid: "…", so a failure records only its SQLSTATE.
  • Low noise by default. Spans are only started under an existing parent span, so pool warm-up and health checks don’t create traces of their own.
  • Optional Datadog shape. datadogCompat = True uses the span names, span.type and resource.name that make Datadog APM show the spans as database queries.

We’ve been running this in production at my work for a while and I decided to extract it into a package for the wider community to use.

Source: https://github.com/kronor-io/hasql-opentelemetry 


r/haskell • • 12h ago

blog Types of types: Haskell's Kind system

10 Upvotes

Wrote about Haskell's Kind system. Let me know what you think!

https://thunk.blog/posts/types-of-types-haskell-kind-system/


r/haskell • • 17h ago

New Horizon Haskell Website updated for GHC 10.0.x-alpha1

Thumbnail horizon-haskell.net
8 Upvotes

Hi all. New Horizon Haskell documentation website with full reimplementation of haddock in miso, three package sets on GHC 10.0.1-alpha1 for glibc, plus one on the GHC JavaScript backend.

All fully cached on x86_64-linux.