Skip to content

Instantly share code, notes, and snippets.

Robert Hensing roberth

View GitHub Profile
@roberth
roberth / Extras.hs
Created November 12, 2018 16:08
Katip higher order scribes
--| Didn't need this after all, but, at least conceptually, this is kind of nice.
module Katip.Extras where
import Protolude
import Data.IORef
import Katip
ioScribe :: IO Scribe
-> IO () -- ^ Finalizer, see 'scribeFinalizer'
@roberth
roberth / Gather.hs
Last active May 12, 2020 18:39
Parsing unordered things
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Gather where
import Protolude
-- | Fold over the outcomes of a type that has an 'Alternative'.
--
-- @Gather@ embodies two steps.
--
@roberth
roberth / dhall-lenient.hs
Created July 1, 2018 20:39
Allow weird stuff when reading Dhall, like redundant fields
module LambdaCI.CLI.Config where
import Prelude()
import Protolude
import System.Directory
import qualified Data.Text.IO as T
import Dhall hiding (Text)
import Dhall.Pretty(prettyExpr, annToAnsiStyle)
@roberth
roberth / nix-shell-bash-completion.nix
Last active June 27, 2018 17:10
Bash completion and more in nix-shell
pkgs.mkShell {
buildInputs = [...];
shellHook = ''
nixShellAddXdgDataDirs(){
local dirs="$(find $buildInputs -mindepth 1 -maxdepth 1 -path '*/share' -printf ':%p')"
dirs=''${dirs/:/}
export XDG_DATA_DIRS=''${XDG_DATA_DIRS:-}''${XDG_DATA_DIRS:+''${dirs:+:}}''${dirs}
}
nixShellAddXdgDataDirs
'';

Intro

nix-shell is a tool unlike any other for working with project dependencies. However, so much more can be done! A lot of this can already be accomplished with nix-shell, so a simple approach might be to fix the flaws in nix-shell and leave the rest of the effort for the community to figure out. That's very modular, but doesn't improve the situation much beyond the status quo. In fact, solutions like IDEs and docker-compose currently provide better solutions for some of the problems (but are stuck in local optima).

Scope?

  • Build dependencies
  • Merge dependencies (buildEnv)

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@roberth
roberth / FP workshop links.md
Last active December 8, 2016 20:15
Links for a Haskell workshop at Software Circus meetup 2016-12-09 Amsterdam