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
#!/usr/bin/env sh | |
# Works with merlin version 2.5.4. Using protocol described at | |
# https://github.com/ocaml/merlin/blob/master/doc/dev/OLD-PROTOCOL.md#type-checking | |
usage () | |
{ | |
echo Usage: either of the following will work: | |
echo | |
echo ' sig module.ml' |
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
(* | |
An incomplete implementation of a type-safe SQL query in F#. | |
The idea is that a query is built up clause by clause, by representing | |
each additional clause being added on to the query as a state transition | |
between different types of queries. We capture these different types as | |
phantom types to make sure that only valid transitions (query clause | |
additions) as defined by us can be carried out. | |
The final result is a 'total query' that can be converted to a string, |
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
open Cmdliner | |
let mycli _ _ = print_endline "Success!" | |
let interface = | |
let docv = "INTERFACE" in | |
let doc = "parse AST as an interface (true or false)" in | |
Arg.(required & pos 0 (some bool) None & info ~docv ~doc []) |
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
import java.nio.file.{ Files, Path, Paths } | |
import resource._ | |
import scala.collection.JavaConversions.iterableAsScalaIterable | |
import scala.concurrent.duration.Duration | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.{ Await, Future } | |
object Main { | |
/** An asynchronous function (inspired by Finagle). */ | |
type Async[A, B] = A => Future[B] |
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
/* | |
Low-priority implicits | |
Thanks to | |
http://www.slideshare.net/NLJUG/scala-design-patterns-age-mooij for | |
pointing me in the right direction | |
*/ | |
trait Ord[A] { | |
/** Returns a1 <= a2 */ | |
def lteq(a1: A, a2: A): Boolean |
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
alter table tblAddresses | |
drop constraint Addresses_NeedAtLeastOnePart; | |
alter table tblPeople | |
drop constraint People_AddressID; | |
alter table tblPeople | |
drop constraint People_NeedAtLeastOneName; | |
alter table tblPeople |
NewerOlder