Skip to content

Instantly share code, notes, and snippets.

==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/04/20 21:01:24 Generated command/internal_plugin_list.go
backend/operation_type.go:3: running "stringer": exec: "stringer": executable file not found in $PATH
backend/local/hook_count_action.go:3: running "stringer": exec: "stringer": executable file not found in $PATH
command/hook_count_action.go:3: running "stringer": exec: "stringer": executable file not found in $PATH
config/resource_mode.go:3: running "stringer": exec: "stringer": executable file not found in $PATH
helper/schema/resource_data_get_source.go:3: running "stringer": exec: "stringer": executable file not found in $PATH
terraform/context_graph_type.go:3: running "stringer": exec: "stringer": executable file not found in $PATH
make: *** [generate] Error 1
`#hash(["issue" . ,handle-issue]
["message" . ,handle-message]
["notification" . ,handle-notification])
(make-immutable-hash ([cons "issue" handle-issue]
[cons "message" handle-message]
[cons "notification" handle-notification]))
@eatonphil
eatonphil / linode-datacenters.sml
Last active September 28, 2016 02:07
Getting Linode datacenters with Ponyo
(*
* Usage: ./a.out
*
* To build:
* Install Poly/ML and Ponyo. Build Ponyo using GNU make.
* You will need to have OpenSSL development headers.
* Build using ponyo-make: ponyo-make linode.sml. Run ./a.out.
*)
structure Datacenter =
struct
@eatonphil
eatonphil / Makefile
Last active September 21, 2016 01:31
HTTP requests over SSL in Poly/ML
.PHONY: all
all:
gcc -shared -fPIC -o ssl.so -lcrypto -lssl ssl.c
polyc ssl.sml
@eatonphil
eatonphil / json.sml
Created July 1, 2016 17:38
json lexer/parser/marshalling functions
structure String = Ponyo.String
structure Format = Ponyo.Format
structure OurChar =
struct
type t = char
open Char
end
structure CharList = Ponyo_Container_List (OurChar);
Google Chrome 51.0.2704.106 (Official Build) (64-bit)
Revision 27e9e15b411edc75a2233a9ad11dc7ae86e243fd-refs/branch-heads/2704_103@{#3}
OS Mac OS X
Blink 537.36 (@27e9e15b411edc75a2233a9ad11dc7ae86e243fd)
JavaScript V8 5.1.281.65
Flash 22.0.0.192
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36
Command Line /Applications/Google Chrome.app/Contents/MacOS/Google Chrome --user-data-dir=/var/folders/fv/ljj18p5978dfzmqfl66t98tm0000gp/T/karma-65133268 --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-background-timer-throttling --no-sandbox --js-flags=--max-old-space-size=8192 --max-new-space-size=8192 --flag-switches-begin --flag-switches-end http://localhost:9876/?id=65133268
Executable Path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Profile Path /private/var/folders/fv/ljj18p5978dfzmqfl66t98tm0000gp/T/karma-65133268/Default
infix >>=
fun (a: 'a option) >>= (b: ('a * 'b) -> 'a option) =
case a of
SOME v => b (v)
| _ => raise Fail "Object<->structure mismatch"
type t = { name: string, id: int }
fun marshall (object) : t =
JsonMarshal.marshallString (object, "name") >>= (fn (object, name) =>
@eatonphil
eatonphil / list.sml
Last active April 20, 2020 17:03
Simple functor example in Standard ML
(*
* $ polyc list.sml
* $ ./a.out
* 2
* 2
*)
signature LIST =
sig
type t
@eatonphil
eatonphil / monad.ml
Created June 7, 2016 20:25
Monads in ocaml
module MaybeMonad = struct
type 'a t = None | Maybe of 'a
let return (a: 'a) : 'a t = Maybe a
let (>>=) (m: 'a t) (f: 'a -> 'b t) : 'b t = match m with
| None -> None
| Maybe a -> f a
let get (m: 'a t) (a: 'a) = match m with
(provide 'sml-mode)
(defface sml-highlight-misc
'((t (:foreground "light blue")))
"SML misc highlighting"
:group 'basic-faces)
(defface sml-highlight-builtin
'((t (:foreground "dark magenta")))
"SML builtin highlighting"