Skip to content

Instantly share code, notes, and snippets.

View nghamilton's full-sized avatar

Nick Hamilton nghamilton

  • Queensland Functional Programming Lab, Data61, CSIRO
  • Brisbane
View GitHub Profile
@nghamilton
nghamilton / Text.hs
Created March 20, 2023 03:06
Text.append appears broken?
module TextIssue where
import Data.Text qualified as Text
import Data.Text.IO qualified as Text
import System.IO
import Network.Socket
working :: IO ()
working = do
input <- Text.hGetLine stdin
@nghamilton
nghamilton / caba-bug.cabal
Created February 7, 2020 03:26
Cabal file parse fail
cabal-version: 3.0
name: cabal-bug
version: 0.1.0.0
build-type: Simple
flag breaks
description: Breaks parsing main-hs.
executable cabal-bug-exe
default-language: Haskell2010
@nghamilton
nghamilton / ..-slash-nix-slash-r-slash-default.nix
Created October 15, 2019 05:06
Nix + R with custom packages
{ nixpkgs ? import ../nixpkgs-overlayed.nix }:
let
rLibs = [ nixpkgs.pkgs.rPackages.tseries nixpkgs.pkgs.rPackages.forecast ];
r = nixpkgs.rWrapper.override {
packages = [ rLibs ];
};
{ nixpkgs ? import ../nix/nixpkgs-overlayed.nix }:
let
common = import ../common { inherit nixpkgs; };
frontend = import ../frontend { inherit nixpkgs; };
r = import ../nix/r { inherit nixpkgs; };
overrides = drv: {
buildInputs = drv.buildInputs ++ [r];
λ: (flip cacheRecipes')
<function>
it :: [Int] -> Text -> IO ()
λ: :t (unsafeRight <$> getAuth)
(unsafeRight <$> getAuth) :: IO Data.Text.Internal.Text
λ: :t ((flip cacheRecipes') [67555])
((flip cacheRecipes') [67555]) :: Text -> IO ()
λ: :t (unsafeRight <$> getAuth) >> ((flip cacheRecipes') [67555])
<interactive>:1:31: error: