diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,27 @@
+Copyright 2015 Tony Morris
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the author nor the names of his contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/Setup.lhs b/Setup.lhs
new file mode 100644
--- /dev/null
+++ b/Setup.lhs
@@ -0,0 +1,44 @@
+#!/usr/bin/env runhaskell
+\begin{code}
+{-# OPTIONS_GHC -Wall #-}
+module Main (main) where
+
+import Data.List ( nub )
+import Data.Version ( showVersion )
+import Distribution.Package ( PackageName(PackageName), PackageId, InstalledPackageId, packageVersion, packageName )
+import Distribution.PackageDescription ( PackageDescription(), TestSuite(..) )
+import Distribution.Simple ( defaultMainWithHooks, UserHooks(..), simpleUserHooks )
+import Distribution.Simple.Utils ( rewriteFile, createDirectoryIfMissingVerbose )
+import Distribution.Simple.BuildPaths ( autogenModulesDir )
+import Distribution.Simple.Setup ( BuildFlags(buildVerbosity), fromFlag )
+import Distribution.Simple.LocalBuildInfo ( withLibLBI, withTestLBI, LocalBuildInfo(), ComponentLocalBuildInfo(componentPackageDeps) )
+import Distribution.Verbosity ( Verbosity )
+import System.FilePath ( (</>) )
+
+main :: IO ()
+main = defaultMainWithHooks simpleUserHooks
+  { buildHook = \pkg lbi hooks flags -> do
+     generateBuildModule (fromFlag (buildVerbosity flags)) pkg lbi
+     buildHook simpleUserHooks pkg lbi hooks flags
+  }
+
+generateBuildModule :: Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
+generateBuildModule verbosity pkg lbi = do
+  let dir = autogenModulesDir lbi
+  createDirectoryIfMissingVerbose verbosity True dir
+  withLibLBI pkg lbi $ \_ libcfg -> do
+    withTestLBI pkg lbi $ \suite suitecfg -> do
+      rewriteFile (dir </> "Build_" ++ testName suite ++ ".hs") $ unlines
+        [ "module Build_" ++ testName suite ++ " where"
+        , "deps :: [String]"
+        , "deps = " ++ (show $ formatdeps (testDeps libcfg suitecfg))
+        ]
+  where
+    formatdeps = map (formatone . snd)
+    formatone p = case packageName p of
+      PackageName n -> n ++ "-" ++ showVersion (packageVersion p)
+
+testDeps :: ComponentLocalBuildInfo -> ComponentLocalBuildInfo -> [(InstalledPackageId, PackageId)]
+testDeps xs ys = nub $ componentPackageDeps xs ++ componentPackageDeps ys
+
+\end{code}
diff --git a/changelog b/changelog
new file mode 100644
--- /dev/null
+++ b/changelog
@@ -0,0 +1,4 @@
+0.0.1
+
+* Initial version.
+
diff --git a/foscam-directory.cabal b/foscam-directory.cabal
new file mode 100644
--- /dev/null
+++ b/foscam-directory.cabal
@@ -0,0 +1,74 @@
+name:               foscam-directory
+version:            0.0.1
+license:            BSD3
+license-file:       LICENSE
+author:             Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> <dibblego>
+maintainer:         Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> <dibblego>
+copyright:          Copyright (C) 2015 Tony Morris
+synopsis:           Foscam File format
+category:           Data
+description:        
+  Directory of Foscam File format
+
+homepage:           https://github.com/tonymorris/foscam-directory
+bug-reports:        https://github.com/tonymorris/foscam-directory
+cabal-version:      >= 1.10
+build-type:         Custom
+extra-source-files: changelog
+
+source-repository   head
+  type:             git
+  location:         git@github.com:tonymorris/foscam-directory.git
+
+flag                small_base
+  description:      Choose the new, split-up base package.
+
+library
+  default-language:
+                    Haskell2010
+
+  build-depends:
+                      base            >= 4     && < 5
+                    , directory       >= 1.2   && < 1.3
+                    , trifecta        >= 1.5   && < 1.6
+                    , utf8-string     >= 1     && < 2.0
+                    , lens            >= 4.0   && < 5
+                    , pretty
+                    , foscam-filename == 0.0.1
+
+  ghc-options:
+                    -Wall
+
+  default-extensions:
+                    NoImplicitPrelude
+
+  hs-source-dirs:
+                    src
+
+  exposed-modules:
+                    Data.Foscam.Directory
+
+test-suite doctests
+  type:
+                    exitcode-stdio-1.0
+
+  main-is:
+                    doctests.hs
+
+  default-language:
+                    Haskell2010
+
+  build-depends:
+                      base             >= 4     && < 5
+                    , doctest          >= 0.9.7 && < 0.11
+                    , filepath         >= 1.3   && < 1.5
+                    , directory        >= 1.1   && < 1.3
+                    , QuickCheck       >= 2.0   && < 3.0
+                    , template-haskell >= 2.8   && < 3.0
+
+  ghc-options:
+                    -Wall
+                    -threaded
+
+  hs-source-dirs:
+                    test
diff --git a/src/Data/Foscam/Directory.hs b/src/Data/Foscam/Directory.hs
new file mode 100644
--- /dev/null
+++ b/src/Data/Foscam/Directory.hs
@@ -0,0 +1,25 @@
+module Data.Foscam.Directory(
+  getFoscamDirectoryContents
+) where
+
+import Data.Foscam.File.Filename
+import System.Directory
+import Text.Trifecta
+import Text.Trifecta.Delta
+import Data.ByteString.UTF8 as UTF8
+import Prelude
+
+data FoscamDirectoryFile =
+  Isn't FilePath
+  | Is Filename
+  deriving (Eq, Ord, Show)
+
+getFoscamDirectoryContents ::
+  FilePath
+  -> IO [FoscamDirectoryFile]
+getFoscamDirectoryContents p =
+  let fromResult (Success n) =
+        Is n
+      fromResult (Failure _) =
+        Isn't p
+  in map (fromResult . parseString filename (Directed (UTF8.fromString p) 0 0 0 0)) <$> getDirectoryContents p
diff --git a/test/doctests.hs b/test/doctests.hs
new file mode 100644
--- /dev/null
+++ b/test/doctests.hs
@@ -0,0 +1,85 @@
+module Main where
+
+import Control.Applicative
+import Prelude
+import Build_doctests (deps)
+import Control.Monad
+import Data.List
+import Data.Monoid
+import System.Directory
+import System.FilePath
+import System.IO
+import Test.DocTest
+
+main ::
+  IO ()
+main =
+  getSources >>= \sources ->
+    forM_ (preferredOrderFirst sources) $ \source -> do
+      hPutStrLn stderr $ "Testing " <> source
+      doctest $
+          "-isrc"
+        : "-idist/build/autogen"
+        : "-optP-include"
+        : "-optPdist/build/autogen/cabal_macros.h"
+        : "-hide-all-packages"
+        : map ("-package="++) deps ++ [source]
+
+sourceDirectories ::
+  [FilePath]
+sourceDirectories =
+  [
+    "src"
+  ]
+
+preferredOrderFirst :: [FilePath] -> [FilePath]
+preferredOrderFirst sources =
+     filter (`elem`    sources       ) preferredOrder
+  <> filter (`notElem` preferredOrder) sources
+
+-- If you find the tests are running slowly.
+-- Comment out the Modules you have completed
+-- in the list below.
+preferredOrder :: [String]
+preferredOrder = map (\f -> "src/Course" </> f <.> "hs") [
+      "List"
+    , "Functor"
+    , "Apply"
+    , "Applicative"
+    , "Bind"
+    , "Monad"
+    , "FileIO"
+    , "State"
+    , "StateT"
+    , "Extend"
+    , "Comonad"
+    , "Compose"
+    , "Traversable"
+    , "ListZipper"
+    , "Parser"
+    , "MoreParser"
+    , "JsonParser"
+    , "Interactive"
+    , "Anagrams"
+    , "FastAnagrams"
+    , "Cheque"
+    ]
+
+isSourceFile ::
+  FilePath
+  -> Bool
+isSourceFile p =
+  and [takeFileName p /= "Setup.hs", isSuffixOf ".hs" p]
+
+getSources :: IO [FilePath]
+getSources =
+  liftM (filter isSourceFile . concat) (mapM go sourceDirectories)
+    where
+      go dir = do
+        (dirs, files) <- getFilesAndDirectories dir
+        (files ++) . concat <$> mapM go dirs
+
+getFilesAndDirectories :: FilePath -> IO ([FilePath], [FilePath])
+getFilesAndDirectories dir = do
+  c <- map (dir </>) . filter (`notElem` ["..", "."]) <$> getDirectoryContents dir
+  (,) <$> filterM doesDirectoryExist c <*> filterM doesFileExist c
