Skip to content

Instantly share code, notes, and snippets.

View acfoltzer's full-sized avatar

Adam C. Foltzer acfoltzer

View GitHub Profile
@acfoltzer
acfoltzer / HOWTO.md
Last active October 6, 2020 11:54
Change git init's default branch name

Change the name of the default branch created by git init

Suppose you want the default branch name created by git init (or tools that shell out to it, like cargo new) to be something other than master. In this example, I'll call it develop.

  1. Add the following to your .gitconfig:

    [init]
        templateDir = ~/.config/git/template/
    
#[macro_use]
extern crate criterion;
use criterion::Criterion;
use lucet_runtime::{DlModule, InstanceHandle, Limits, MmapRegion, Module, Region};
use lucet_wasi_sdk::Link;
use lucetc::{Bindings, Lucetc};
use std::path::Path;
use std::sync::Arc;
use tempfile::TempDir;
Resolving "dracula" via http://download.racket-lang.org/releases/6.3/catalog/
Resolving "dracula" via http://pkgs.racket-lang.org
Using cached14514348221451434822011 for github://github.com/carl-eastlund/dracula/release
raco setup: version: 6.3
raco setup: platform: x86_64-macosx [3m]
raco setup: installation name: 6.3
raco setup: variants: 3m
raco setup: main collects: /Applications/Racket v6.3/collects
raco setup: collects paths:
raco setup: /Users/acfoltzer/Library/Racket/6.3/collects
aig 43 4 0 4 39
81
87
55
60
  

  )
'-
+  )
emptyK :: r -> r
emptyK = id
myLength :: [a] -> (Int -> r) -> r
myLength xs k =
case xs of
[] -> k 0
(_:xs') -> myLength xs' $ \n -> k (n+1)
ex1 = myLength [] emptyK
// Constraining properties based on String-specific inputs
// In Cryptol, `String n` is just an alias for `[n][8]` (ASCII)
type IPv4String = String 15
// Print four octets as an IPv4-formatted string
printIp : [4][8] -> IPv4String
printIp ip = x # "." # y # "." # z # "." # w
where
[x, y, z, w] = [ printByte b | b <- ip ]
This file has been truncated, but you can view the full file.
Using a sandbox located at /private/tmp/stack/.cabal-sandbox
/Users/acfoltzer/.cabal/bin/alex --version
/Users/acfoltzer/.cabal/bin/c2hs --numeric-version
/usr/bin/gcc -dumpversion
/usr/local/bin/haddock --version
/Users/acfoltzer/.cabal/bin/happy --version
/usr/local/bin/hpc version
looking for tool hsc2hs near compiler in /usr/local/bin
found hsc2hs in /usr/local/bin/hsc2hs
/usr/local/bin/hsc2hs --version
@acfoltzer
acfoltzer / idris.rb
Last active August 29, 2015 14:13
Updated idris formula
require "language/haskell"
class Idris < Formula
include Language::Haskell::Cabal
homepage "http://www.idris-lang.org"
depends_on "ghc" => :build
depends_on "cabal-install" => :build
depends_on "gmp"
@acfoltzer
acfoltzer / gist:52055b418ef984e91faf
Created July 29, 2014 03:20
Examples from Haskell Office Hours
{-# LANGUAGE FlexibleInstances #-}
-- | A simple datatype similar to 'Bool'
data A = B | C
a :: A
a = B
-- | A more complicated datatype with values associated with each constructor.
data Foo = Bar Int String | Baz (Bool -> Bool)
@acfoltzer
acfoltzer / gist:7188179
Last active December 26, 2015 17:39
Haskell.org Committee Self-Nomination

Dear Committee,

I'm writing to nominate myself for a position on the haskell.org committee.

As a working Haskell developer at Galois, having reliable infrastructure is deeply important to me, and I would like to help maintain it however I can. I have experience maintaining web, mail, and IRC servers, as well as acquiring and configuring SSL certificates for those services. I hope that these skills may prove of use to the committee.

I also believe this is a critical point in the growth of our community. As adoption of Haskell increases, the decisions we make now will shape how our community develops, for good or for bad. I was moved by Chung-chieh Shan's [Haskell 2013 Program Chair report][1]. As he says, it can be hard work to speak one's mind with compassion, but let me try so that you can know better my concerns and what I hope to work towards.

I believe that a lack of diversity is one of the primary problems facing the Haskell community today. Ashe Dryden recently spoke at Galois and gave an excellent