Skip to content

Instantly share code, notes, and snippets.

@ion1
ion1 / 0readme.md
Last active October 22, 2018 18:52
Emulating the elegance of JavaScript's `new Array` in Haskell

Emulating the elegance of JavaScript's new Array in Haskell

What does new Array(x) do? Trick question. It does different things depending on whether x is an integer or something else.

I wanted to replicate this elegant functionality in Haskell: behold.

@int-index
int-index / NamedDefaults.hs
Created April 23, 2018 12:38
named-defaults
{-# LANGUAGE KindSignatures, DataKinds, FlexibleInstances, FlexibleContexts,
FunctionalDependencies, TypeFamilies, TypeOperators,
PatternSynonyms, UndecidableInstances, ConstraintKinds,
TypeApplications, ScopedTypeVariables, CPP #-}
module NamedDefaults (FillDefaults, fillDefaults, (!.)) where
import Prelude (Maybe(..), id)
import Data.Kind (Type)

I've been working quite extensively with Wizek during last several days. In few words: I am very motivated by my experience and I hope that there will be a community for pair-programming. My intuition is that you exchange your time for the ability to stay focused and motivated.

Below is more structured feedback.

Open questions: I was working with a haskeller who is more experienced than me and I was working on a completely new project. I think that there are different possible setups which will lead to a different experience:

  • working with someone who has the same or smaller amount of experience;
  • working on something very familiar to you.

Positive feedback:

@3noch
3noch / .ghci
Last active October 29, 2018 09:49
Reflex-DOM Auto Reload Development with ghcid
:set prompt "> "
:set -isrc
:load Main
@Profpatsch
Profpatsch / hpack2nix.nix
Created May 26, 2017 18:00
hpack to nix file in nix expression
let
hpack2nix =
name: src:
let
addCabalFile = stdenv.mkDerivation {
inherit name src;
phases = [ "unpackPhase" "patchPhase" "installPhase" ];
installPhase = ''cp -r . $out'';
patchPhase = ''
${haskellPackages.hpack}/bin/hpack
@olejorgenb
olejorgenb / nix-package-search
Last active July 4, 2022 15:22
nix-package-search
@lspitzner
lspitzner / a.txt
Created July 1, 2016 20:02
sublime3+ghcid setup for quick haskell coding feedback
sublime3 and ghcid setup for quick haskell coding feedback
tested on sublime 3
(you can omit the SublimeOnSaveBuild steps, as the result is not
completely reliable anyways. i still find it useful, though.)
steps:
- install https://github.com/lspitzner/SublimeOnSaveBuild
(original from alexnj; in his/her version the build-window gets closed
@scottlinux
scottlinux / backblaze b2 backup script
Last active November 6, 2019 23:12
Backup script for backblaze b2
#!/usr/bin/env bash
#
# Backup selected directories to a Backblaze B2 bucket
#
# Example daily cron:
# @daily /usr/local/bin/b2backup >/dev/null
#
# Account creds
id=xxxxxxxxxx
@novaluke
novaluke / 0-Q&A.md
Last active April 29, 2023 17:23
I want to use Nix for development, but... -- answers to common concerns about Nix

Nix seems perfect for developers - until I try to use it...

Want to use Nix for development but you're not sure how? Concerned about the fluidity of nixpkgs channels or not being able to easily install arbitrary package versions?

When I first heard about Nix it seemed like the perfect tool for a developer. When I tried to actually use it for developing and deploying web apps, though, the pieces just didn't seem to add up.

@Wizek
Wizek / rc.js
Last active August 29, 2015 14:27
.jsrc
function c () {
console.log.apply(console, arguments)
return arguments[arguments.length-1]
}
var unboundSlice = Array.prototype.slice
var slice = Function.prototype.call.bind(unboundSlice)