Skip to content

Commit 3fd99a2

Browse files
committed
Repository initialized
0 parents  commit 3fd99a2

File tree

13 files changed

+277
-0
lines changed

13 files changed

+277
-0
lines changed

.ghci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:set -isrc -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
dist
2+
docs
3+
wiki
4+
TAGS
5+
tags
6+
wip
7+
.DS_Store
8+
.*.swp
9+
.*.swo
10+
*.o
11+
*.hi
12+
*~
13+
*#

.travis.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
language: haskell
2+
before_install:
3+
# Uncomment whenever hackage is down.
4+
# - mkdir -p ~/.cabal && cp travis/config ~/.cabal/config && cabal update
5+
6+
# Try installing some of the build-deps with apt-get for speed.
7+
- travis/cabal-apt-install --only-dependencies --force-reinstall $mode
8+
9+
- sudo apt-get -q -y install hlint || cabal install hlint
10+
11+
install:
12+
- cabal configure $mode
13+
- cabal build
14+
15+
script:
16+
- $script
17+
- hlint src --cpp-define HLINT
18+
19+
notifications:
20+
irc:
21+
channels:
22+
- "irc.freenode.org#haskell-lens"
23+
skip_join: true
24+
template:
25+
- "\x0313foo\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"
26+
27+
env:
28+
- mode="--enable-tests" script="cabal test"

.vim.custom

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
" Add the following to your .vimrc to automatically load this on startup
2+
3+
" if filereadable(".vim.custom")
4+
" so .vim.custom
5+
" endif
6+
7+
function StripTrailingWhitespace()
8+
let myline=line(".")
9+
let mycolumn = col(".")
10+
silent %s/ *$//
11+
call cursor(myline, mycolumn)
12+
endfunction
13+
14+
" enable syntax highlighting
15+
syntax on
16+
17+
" search for the tags file anywhere between here and /
18+
set tags=TAGS;/
19+
20+
" highlight tabs and trailing spaces
21+
set listchars=tab:‗‗,trail:‗
22+
set list
23+
24+
" f2 runs hasktags
25+
map <F2> :exec ":!hasktags -x -c --ignore src"<CR><CR>
26+
27+
" strip trailing whitespace before saving
28+
" au BufWritePre *.hs,*.markdown silent! cal StripTrailingWhitespace()
29+
30+
" rebuild hasktags after saving
31+
au BufWritePost *.hs silent! :exec ":!hasktags -x -c --ignore src"

CHANGELOG.markdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
0.1
2+
---
3+
* Repository initialized

HLint.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import "hint" HLint.Default

LICENSE

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Copyright 2011 Edward Kmett
2+
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions
7+
are met:
8+
9+
1. Redistributions of source code must retain the above copyright
10+
notice, this list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright
13+
notice, this list of conditions and the following disclaimer in the
14+
documentation and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the author nor the names of his contributors
17+
may be used to endorse or promote products derived from this software
18+
without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
21+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
24+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29+
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
POSSIBILITY OF SUCH DAMAGE.

README.markdown

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
foo
2+
===
3+
4+
[![Build Status](https://secure.travis-ci.org/ekmett/foo.png?branch=master)](http://travis-ci.org/ekmett/foo)
5+
6+
Contact Information
7+
-------------------
8+
9+
Contributions and bug reports are welcome!
10+
11+
Please feel free to contact me through github or on the #haskell IRC channel on irc.freenode.net.
12+
13+
-Edward Kmett

Setup.lhs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/runhaskell
2+
\begin{code}
3+
{-# OPTIONS_GHC -Wall #-}
4+
module Main (main) where
5+
6+
import Data.List ( nub )
7+
import Data.Version ( showVersion )
8+
import Distribution.Package ( PackageName(PackageName), PackageId, InstalledPackageId, packageVersion, packageName )
9+
import Distribution.PackageDescription ( PackageDescription(), TestSuite(..) )
10+
import Distribution.Simple ( defaultMainWithHooks, UserHooks(..), simpleUserHooks )
11+
import Distribution.Simple.Utils ( rewriteFile, createDirectoryIfMissingVerbose )
12+
import Distribution.Simple.BuildPaths ( autogenModulesDir )
13+
import Distribution.Simple.Setup ( BuildFlags(buildVerbosity), fromFlag )
14+
import Distribution.Simple.LocalBuildInfo ( withLibLBI, withTestLBI, LocalBuildInfo(), ComponentLocalBuildInfo(componentPackageDeps) )
15+
import Distribution.Verbosity ( Verbosity )
16+
import System.FilePath ( (</>) )
17+
18+
main :: IO ()
19+
main = defaultMainWithHooks simpleUserHooks
20+
{ buildHook = \pkg lbi hooks flags -> do
21+
generateBuildModule (fromFlag (buildVerbosity flags)) pkg lbi
22+
buildHook simpleUserHooks pkg lbi hooks flags
23+
}
24+
25+
generateBuildModule :: Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
26+
generateBuildModule verbosity pkg lbi = do
27+
let dir = autogenModulesDir lbi
28+
createDirectoryIfMissingVerbose verbosity True dir
29+
withLibLBI pkg lbi $ \_ libcfg -> do
30+
withTestLBI pkg lbi $ \suite suitecfg -> do
31+
rewriteFile (dir </> "Build_" ++ testName suite ++ ".hs") $ unlines
32+
[ "module Build_" ++ testName suite ++ " where"
33+
, "deps :: [String]"
34+
, "deps = " ++ (show $ formatdeps (testDeps libcfg suitecfg))
35+
]
36+
where
37+
formatdeps = map (formatone . snd)
38+
formatone p = case packageName p of
39+
PackageName n -> n ++ "-" ++ showVersion (packageVersion p)
40+
41+
testDeps :: ComponentLocalBuildInfo -> ComponentLocalBuildInfo -> [(InstalledPackageId, PackageId)]
42+
testDeps xs ys = nub $ componentPackageDeps xs ++ componentPackageDeps ys
43+
44+
\end{code}

foo.cabal

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: foo
2+
category: foo
3+
version: 0.1
4+
license: BSD3
5+
cabal-version: >= 1.10
6+
license-file: LICENSE
7+
author: Edward A. Kmett
8+
maintainer: Edward A. Kmett <[email protected]>
9+
stability: experimental
10+
homepage: http://github.com/ekmett/foo/
11+
bug-reports: http://github.com/ekmett/foo/issues
12+
copyright: Copyright (C) 2013 Edward A. Kmett
13+
synopsis: foo
14+
description: foo
15+
build-type: Custom
16+
17+
extra-source-files:
18+
.ghci
19+
.gitignore
20+
.travis.yml
21+
.vim.custom
22+
CHANGELOG.markdown
23+
HLint.hs
24+
README.markdown
25+
travis/cabal-apt-install
26+
travis/config
27+
28+
source-repository head
29+
type: git
30+
location: git://github.com/ekmett/foo.git
31+
32+
library
33+
hs-source-dirs: src
34+
default-language: Haskell2010
35+
ghc-options: -Wall
36+
build-depends:
37+
base >= 4.4 && < 5
38+
39+
test-suite doctests
40+
type: exitcode-stdio-1.0
41+
main-is: doctests.hs
42+
default-language: Haskell2010
43+
build-depends:
44+
base,
45+
directory >= 1.0,
46+
doctest >= 0.9.1,
47+
filepath
48+
ghc-options: -Wall -threaded
49+
if impl(ghc<7.6.1)
50+
ghc-options: -Werror
51+
hs-source-dirs: tests

0 commit comments

Comments
 (0)