This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unique type Guid = Guid Nat Nat Nat Nat | |
Guid.data1 = cases | |
Guid data1 _ _ _ -> data1 | |
Guid.data2 = cases | |
Guid _ data2 _ _ -> data2 | |
Guid.data3 = cases | |
Guid _ _ data3 _ -> data3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "hello" | |
version = "0.1.0" | |
authors = ["P. Oscar Boykin <[email protected]>"] | |
edition = "2018" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
csv = "1.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# unbind some default keybindings | |
unbind C-b | |
# set prefix key to ctrl-a | |
set -g prefix C-o | |
# lower command delay | |
set -sg escape-time 1 | |
# start first window and pane at 1, not zero |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> { | |
overlays = map import [ ./nix/rust-overlay.nix ]; | |
}; | |
stdenv.mkDerivation rec { | |
name = "hatchway"; | |
buildInputs = [ | |
rustChannels.stable.rust | |
# rustChannels.nightly.rust | |
openssl | |
pkgconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun stew-write-file (fn str) | |
(with-temp-buffer | |
(insert str) | |
(write-region (point-min) (point-max) fn t))) | |
(defun stew-make-build.properties (fn) | |
(let ((build.properties (concat "sbt.version=" sbt-version "\n"))) | |
(stew-write-file fn build.properties))) | |
(defun stew-make-plugins.sbt (fn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object BTree { | |
type Children[A] = (Option[A], Option[A]) | |
// We can define a non-empty binary tree as being a Cofree using the | |
// above pattern, with each node labelled by both a value, and | |
// memoized height of the tree. | |
type BTree[A] = Cofree[Children, (A,Int)] | |
@inline def extract[A](x: BTree[A]) = x.head._1 | |
@inline def height[A](x: BTree[A]): Int = x.head._2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package adjunction | |
import cats._ | |
/** | |
* An Adjunction is a relationship between two functors: | |
* - `F`, the "left-adjoint" | |
* - `G`, the "right-adjoint" | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adjunction | |
import cats._ | |
abstract class Adjunction[F[_], G[_]] { self => | |
def left[A,B](a: A)(f: F[A] => B): G[B] | |
def right[A,B](fa: F[A])(f: A => G[B]): B | |
def unit[A](a: A): G[F[A]] = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dogs | |
import Predef._ | |
import dogs.Order.{GT, EQ, LT, Ordering} | |
import dogs.std.intOrder | |
import scala.annotation.tailrec | |
import scala.math | |
sealed abstract class BinaryTree[A] { | |
import BinaryTree._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def runTraverseRWST[F[_], G[_], R, W: Monoid, S, A, B](fa: F[A])(f: A => RWST[G,R,W,S,B])(r: R, s: S)(implicit F: Traverse[F], G: Monad[G]): G[(W,F[B],S)] = { | |
F.traverse[({type λ[α]=RWST[G,R,W,S,α]})#λ,A,B](fa)(f)(RWST.rwstMonad[G,R,W,S]).run(r,s) | |
} | |
NewerOlder