Skip to content

Instantly share code, notes, and snippets.

module Program
let add x y = x + y
let add10 = add 10
let explicit_add_10 x = x + 10
(* the above types as:
@lepoetemaudit
lepoetemaudit / parser.alp
Created September 1, 2017 17:26
Quick Alpaca parser/combinator tests
module main
type result 'a 'b = Error 'a | Ok 'b
type parser 'a = fn binary -> result string ('a, binary)
let (<|) f x = f x
let (|>) x f = f x
let assertEquals a b =

Keybase proof

I hereby claim:

  • I am lepoetemaudit on github.
  • I am sopost_dj (https://keybase.io/sopost_dj) on keybase.
  • I have a public key ASAXEY6a_byrLsGjd6tlSSGl7TM8J-FCT8bDt3PTjKplzAo

To claim this, I am signing this object:

@lepoetemaudit
lepoetemaudit / install.sh
Last active June 25, 2018 10:53
Install Luml - macOS / Darwin
echo "Installing Luml - sudo required" && sudo echo "Ok, installing!" && mkdir -p /tmp/luml && curl -Ls https://github.com/luml-lang/luml/releases/download/v0.0.1/luml-0.0.1-darwin.tgz | tar -xz -C /tmp/luml && sudo cp -r /tmp/luml/release/bin/* /usr/local/bin && sudo cp -r /tmp/luml/release/lib/* /usr/local/lib && rm -r /tmp/luml && echo "Luml successfuly installed"
@lepoetemaudit
lepoetemaudit / sum.go
Created July 8, 2018 12:40
sum in golang
package main
import "fmt"
func sum(numbers []int) int {
if len(numbers) == 0 {
return 0
} else {
return numbers[0] + sum(numbers[1:])
}
@lepoetemaudit
lepoetemaudit / sum.c
Created July 10, 2018 09:34
C version of recursive sum (with sentinel)
#include <stdio.h>
int sum(int *numbers) {
if (numbers[0] == -1) {
return 0;
} else {
return numbers[0] + sum(numbers + 1);
}
}