Skip to content

Instantly share code, notes, and snippets.

Robert Hensing roberth

View GitHub Profile
@roberth
roberth / example.nix
Created June 21, 2019 09:26
concurrent, event sourced, side effecting Nix via bash
#!./interpret.nix
{ io, args, ... }:
let
main =
io.printLine "I'm hi, who are you?" ask;
ask =
io.readLine (name:
@roberth
roberth / Ghost.hs
Created November 11, 2019 14:53
Ghost prototype
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE ExplicitNamespaces #-}
{-# LANGUAGE TypeOperators #-}
-- | An alternate implementation of the Ghosts of Departed Proofs <https://kataskeue.com/gdp.pdf idea>,
@roberth
roberth / README.md
Created June 1, 2021 08:50
Why no 👎 reaction?

Why no 👎 reaction?

The main problem with the 👎 reaction is that it does not carry any constructive feedback or explanation.

In some cases, it is added to a pull request early on, before the author has had a chance to improve their proposal. The person placing the reaction often will not receive a notification of the improvements and even if they did, they may forget to remove the 👎.

These effects are not obvious to the author or the person reacting; let alone to the reader. This causes friction for everyone involved.

But I don't want to add noise!

@roberth
roberth / Partitioner.hs
Last active October 3, 2021 09:57
Ugly Folds
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
-- | This is a strict, somewhat efficient implementation of something between 'Data.List.partition' and Beautiful Folding.
--
-- It allows a (pure or ST) stream of values to be processed into multiple fields, using a nice 'Applicative' interface.
@roberth
roberth / QueryPart.hs
Created April 16, 2022 18:57
hasql QueryPart
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Hasql.Extras.QueryPart where
import Data.Functor.Compose
import Data.String (IsString (..))
import qualified Hasql.Decoders as HD
import qualified Hasql.Encoders as HE
import qualified Hasql.Statement as HQ
@roberth
roberth / minimod.nix
Last active December 29, 2023 07:47
Simple and quick module system alternative + thoughts and tasks
/*
minimod: A stripped down module system
TODO Comparison:
- [ ] Come up with a benchmark "logic" using plain old functions and let bindings
- [ ] Write the benchmark for the module system
- [ ] Write the benchmark for POP?
- [ ] Qualitative comparison of extensibility in the context of composable
Nixpkgs packaging logic
TODO Fine-tuning:
@roberth
roberth / ACES-Protocol.md
Created October 19, 2022 12:44
ACES Protocol (draft)

NOTE: this is a draft

TODO comments are in the source

This spec must be validated by implementing it in at least one library. I may do this in Haskell's optparse-applicative.