Skip to content

Instantly share code, notes, and snippets.

View nkpart's full-sized avatar

Nick Partridge nkpart

  • Brisbane, Australia
View GitHub Profile
@nkpart
nkpart / info.md
Last active February 25, 2020 03:57
Issues calling C function from Haskell on aarch64

Using GHC 8.8.1 cross compiler, targeting aarch64-apple-ios.

Haskell:

type ArgType = Int32
foreign import ccall safe "f32" f32 :: ArgType -> ... 31 more times -> IO ()

runMe :: IO ()
runMe =
\version "2.18.2"
\header{
title = "Cam's Clootch is Awee"
composer = "Partro"
}
\include "common.ly"
\paper {
call plug#begin('~/.local/share/nvim/plugged')
Plug 'rafi/awesome-vim-colorschemes'
Plug 'NLKNguyen/papercolor-theme'
Plug '/nix/store/dwxiva3adj5931g49scw9zip64n8ip9i-fzf-0.17.3/share/go/src/github.com/junegunn/fzf'
Plug 'junegunn/fzf.vim'
" Plug 'nbouscal/vim-stylish-haskell'
Plug 'alx741/vim-hindent'
Prelude> :set -XDerivingStrategies
Prelude> :set -XGeneralizedNewtypeDeriving
Prelude> newtype Foo = Foo Int deriving newtype Show
Prelude> Foo 3
3
Prelude> newtype BFoo = BFoo Int deriving Show
Prelude> BFoo 3
BFoo 3
Linking dist/build/test/test ...
running tests
Running 1 test suites...
Test suite test: RUNNING...
dyld: Symbol not found: __cg_png_create_info_struct
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /nix/store/g23c1b3k7qqx3j78iqlbvyy9s0gfcvni-libpng-apng-1.6.34/lib/libpng16.16.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
∴ cat cabal.project
packages: tools/work-common/
          tools/work-project/

I did the expected thing, and tried to build everything:

∴ cabal new-build
{ nixpkgs ? import <nixpkgs> {}
}:
let
inherit (nixpkgs) pkgs;
python = let
packageOverrides = self: super: {
# sklearn tests fail on darwin
scikitlearn = super.scikitlearn.overridePythonAttrs(old: rec {
doCheck = false;
~/p/reflex-platform/reflex-tutorial
∴ gsp
remote: Counting objects: 64, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 64 (delta 32), reused 35 (delta 32), pack-reused 26
Unpacking objects: 100% (64/64), done.
From https://github.com/qfpl/reflex-tutorial
9d1135d..e71cbc3 master -> origin/master
Successfully rebased and updated refs/heads/master.
~/p/reflex-platform/reflex-tutorial
@nkpart
nkpart / Joining CSV Tables in Haskell.md
Last active June 27, 2019 16:27
Joining CSV Tables in Haskell

Joining CSV Tables in Haskell

This article describes a technique for joining (in an SQL-style) lists of haskell data structures.

Maybe not the fastest, maybe not the smartest, but it works.

Why I like it

~/p/reflex-platform
∴ ./try-reflex
If you have any trouble with this script, please submit an issue at https://github.com/reflex-frp/reflex-platform/issues
Entering the reflex sandbox...
building path(s) ‘/nix/store/8p1h37cb5466p6g2nxyr6pirpg3fr0c5-all-cabal-hashes-2b0bf3ddf8b75656582c1e45c51caa59458cd3ad-src’
trying https://github.com/commercialhaskell/all-cabal-hashes/archive/2b0bf3ddf8b75656582c1e45c51caa59458cd3ad.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 176 0 176 0 0 176 0 --:--:-- 0:00:01 --:--:-- 128