Skip to content

Instantly share code, notes, and snippets.

View jkachmar's full-sized avatar
🏳️‍⚧️

jkachmar jkachmar

🏳️‍⚧️
View GitHub Profile
@ChadSki
ChadSki / conda-cuda-fhs-nix-flake-shell.md
Last active December 26, 2023 07:43
Nix flake shell with conda and cuda in an FHS user environment

Run NIXPKGS_ALLOW_UNFREE=1 nix develop --impure to enter the shell, then conda update conda.

@parsonsmatt
parsonsmatt / mbc.hs
Created February 21, 2020 18:54
Compatibility function to make MonadUnliftIO and MonadBaseControl IO work together
{-
Oh no! You're lost in a twisty maze of IO lifting and unlifting, and you've come to
an impossible fork: you're currently in some monad that is `MonadBaseControl IO m`,
but you need to call a function in `MonadUnliftIO`. AND you need to call functions
in your original monad transformer, too!
We can make this work, but it's a bit hairy.
MonadUnliftIO is a strictly less powerful type class than `MonadBaseControl IO`, so
@Daenyth
Daenyth / Pull.md
Last active November 9, 2023 17:14
Designing an fs2 `Pull` from scratch

The problem

I have some data which has adjacent entries that I want to group together and perform actions on. I know roughly that fs2.Pull can be used to "step" through a stream and do more complicated logic than the built in combinators allow. I don't know how to write one though!

In the end we should have something like

def combineAdjacent[F[_], A](
 shouldCombine: (A, A) => Boolean,
newtype JSONB a = JSONB { unJSONB :: a }
deriving
( Generic
, Eq
, Foldable
, Functor
, Ord
, Read
, Show
, Traversable