Skip to content

Instantly share code, notes, and snippets.

@simonwelsh
Created April 30, 2014 01:06
Show Gist options
  • Save simonwelsh/6d2536b03dcc1293b50f to your computer and use it in GitHub Desktop.
Save simonwelsh/6d2536b03dcc1293b50f to your computer and use it in GitHub Desktop.
<?hh // strict
namespace beatbox;
type Path = ImmVector<string>;
type Extension = ?string;
type Metadata = Map<string, mixed>;
type FragmentHandler = (function(Path, Extension, Metadata): mixed);
type CheckerCallback = (function(string, Metadata): bool);
type FragmentTable = Map<string, FragmentHandler>;
type CheckerTable = Map<string, CheckerCallback>;
type PathTable = Pair<FragmentTable, Metadata>;
type RouteTable = Map<string, PathTable>;
type SimpleRouteTable = Map<string, FragmentTable>;
type RequestStackItem = (Path, Extension, FragmentTable, Metadata);
type RequestStack = Vector<RequestStackItem>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment