"linear-locks: locking primitives free of deadlocks"

If you encounter STM's limitations when it comes to lock-free synchronisation, then Linear Haskell-backed locks maybe the solution you want!

https://discourse.haskell.org/t/ann-linear-locks-locking-primitives-free-of-deadlocks/14112

#Haskell

[ANN] linear-locks: locking primitives free of deadlocks

linear-locks provides locking primitives that are statically guaranteed not to lead to deadlocks. It achieves this by breaking one of the Coffman conditions for deadlocks: the “circular wait” condition. linear-locks ensures locks are always acquired in a consistent order. tl;dr: Each lock is assigned a “level”, tracked at the type level. When you enter a “lock scope”, you’re given a key that can acquire locks of level 0 or above. When you acquire a lock of level n, the key is consumed and you’...

Haskell Community

In January 2027, I will teach the first instalment of the new BSc course "Functional Programming: continuation course" (joint between Chalmers and UGOT). https://share.google/int8wna1Pjo9T1tGE
Within a month or so, I need to decide on the course literature. I'd be very happy to receive thoughts, suggestions, warnings, etc. about what you think would work, or not.
More details below:

Learning outcomes:
Knowledge and understanding:

+ Explain and apply fundamental abstractions in functional programming, including lazy/strict evaluation, functors, & monads, and describe how these abstractions can be used to handle state, exceptions, and I/O in a purely functional way.
+ Explain how algebraic properties such as associativity and commutativity enable divide-and-conquer and parallel evaluation in pure functional programs, and discuss how purity and referential transparency support the design of compositional embedded domain-specific languages (EDSLs).

Skills and abilities:

+ Design, structure, and implement functional programs and small EDSLs using appropriate type classes, algebraic operators, and data structures for efficient and, where appropriate, parallel computation.
+ Apply functional techniques such as recursion schemes, memoization, and algebraic composition to implement and reason about non-trivial algorithms.
+ Use relevant tools and libraries to develop, test, and document maintainable programs, including performance analysis and identification of common inefficiencies.
+ Structure and solve real-world programming problems in a functional style, integrating abstraction, testing, and reasoning for correctness and efficiency.

Judgement and approach:

+ Critically assess the suitability of abstractions and algebraic structures for specific programming problems, through reflection on the trade-offs between abstraction, performance, and resource use.
+ Evaluate program design decisions and correctness using property-based testing, algebraic properties, and equational reasoning.
+ Demonstrate responsibility in program design and collaboration, ensuring modularity, clear documentation, and maintainability.

#Haskell

Functional Programming: continuation course

Issue 524 :: Haskell Weekly newsletter

https://programming.dev/post/50376547

Issue 524 :: Haskell Weekly newsletter - programming.dev

Lemmy

[ANN] hpgsql, a pure Haskell PostgreSQL driver (no libpq)

It’s a pleasure to announce hpgsql, a PostgreSQL driver written in pure Haskell (no libpq), with an API largely inspired by the great postgresql-simple library, but featuring: Usage of PostgreSQL’s binary protocol Query arguments passed via the protocol instead of being escaped into the query string Pipelining Prepared statements Ability to stream query results directly from the socket (not just with cursors) Interruption safety, except for very specific (and documented) edge cases Thread safe...

Haskell Community

Problem of the day:

Derive a fused function equal to `dupLast . dupLast` where

dupLast [] = []
dupLast [x] = [x,x]
dupLast (x:xs) = x : dupLast xs

Experienced functional programmers might see at a glance what the fused function looks like, but how do we derive it formally from the definition of `dupLast`?

#haskell #functionalprogramming

Despite not having particularly strong feelings about either #docker or #k8s, I designed and 3d-printed their logos (using #haskell code)

https://github.com/joe-warren/christmas-ornaments/

#3dprinting

Another stream tonight, trying to figure out how to build a MUD server in Haskell. 8:10pm ET

https://twitch.tv/agentultra

#haskell

agentultra - Twitch

Streaming adventures in Haskell programming. I like cats, reading, music, and board games too.

Twitch

I made another one in the Yet Another category: YAAIP (Yet Another AI Prompter that helps create JSON prompts)

#AI #JSON #LLM #haskell

https://yaaip.photonsphere.org/

YAAIP

Yet Another AI Prompter application

Anyone know a common name for a function that lifts only one side (only the codomain) of another function into a functor/monad/effect?

Something like

Monad m => (a -> b) -> a -> m b

Feels like this transformation comes up often when using asynchronous frameworks. It "lifts" a synchronous function into an `async` function.

Perhaps it doesn't need a name, since it's maybe just the composition

liftM f . return

#functionalprogramming #haskell #typescript

I like #Haskell first and foremost because of the language itself. But as supply chain attacks get more common, some may be interested in Stackage, which curates snapshots of Haskell packages with the guarantee, that all packages of a certain snapshot work together. Having a fixed set of packages/versions could be a nice firewall against such attacks that depend on everyone using the latest/greatest all the time.

https://www.stackage.org/

Stackage Server

Stackage