Skip to content

Instantly share code, notes, and snippets.

View DavidGregory084's full-sized avatar

David Gregory DavidGregory084

View GitHub Profile

i3 configuration

First of some fixes for your i3 config:

# Plasma compatibility improvements
for_window [title="Desktop — Plasma"] kill; floating enable; border none
for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable

for_window [class="systemsettings"] floating enable
@hwayne
hwayne / Unique.dfy
Last active April 11, 2018 20:31
Dafny
method Unique(a: seq<int>) returns (b: seq<int>)
ensures forall k :: 0 <= k < |a| ==> a[k] in b
ensures forall i, j :: 0 <= i < j < |b| ==> b[i] != b[j]
{
var index := 0;
b := [];
while index < |a|
invariant index <= |a|
invariant forall i, j :: 0 <= i < j < |b| ==> b[i] != b[j]
invariant forall k :: 0 <= k < index ==> a[k] in b
@milessabin
milessabin / gist:6c9c060cf5159563b722d49ce9ee103e
Last active July 26, 2017 20:42
Induction benchmark: vanilla scalac vs. scalac + proof of concept inductive solver
// Compiled with ./build/pack/bin/scalac -J-Xss4M -J-Xmx4G test/files/pos/inductive-implicits.scala
// HList scalac scalac +
// Size inductive heuristics
// 50 6 4
// 100 15 5
// 150 36 6
// 200 68 6
// 250 114 7
// 300 179 9

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x