Initial commit

This commit is contained in:
Mats Rauhala 2020-12-10 19:47:11 +02:00
commit 3226856439
10 changed files with 133 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
dist-newstyle
dist
tags
.envrc

5
CHANGELOG.md Normal file
View File

@ -0,0 +1,5 @@
# Revision history for addressbook
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.

30
LICENSE Normal file
View File

@ -0,0 +1,30 @@
Copyright (c) 2020, Mats Rauhala
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* Neither the name of Mats Rauhala nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
OWNER 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.

2
Setup.hs Normal file
View File

@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain

45
addressbook.cabal Normal file
View File

@ -0,0 +1,45 @@
cabal-version: 2.4
-- Initial package description 'addressbook.cabal' generated by 'cabal
-- init'. For further documentation, see
-- http://haskell.org/cabal/users-guide/
name: addressbook
version: 0.1.0.0
-- synopsis:
-- description:
-- bug-reports:
license: BSD-3-Clause
license-file: LICENSE
author: Mats Rauhala
maintainer: mats.rauhala@iki.fi
-- copyright:
-- category:
extra-source-files: CHANGELOG.md
library
exposed-modules: MyLib
-- other-modules:
-- other-extensions:
build-depends: base ^>=4.13.0.0
, attoparsec
, mtl
, pipes
, pipes-bytestring
, text
hs-source-dirs: src
default-language: Haskell2010
executable addressbook
main-is: Main.hs
-- other-modules:
-- other-extensions:
build-depends: base ^>=4.13.0.0, addressbook
hs-source-dirs: app
default-language: Haskell2010
test-suite addressbook-test
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: MyLibTest.hs
build-depends: base ^>=4.13.0.0

8
app/Main.hs Normal file
View File

@ -0,0 +1,8 @@
module Main where
import qualified MyLib (someFunc)
main :: IO ()
main = do
putStrLn "Hello, Haskell!"
MyLib.someFunc

16
default.nix Normal file
View File

@ -0,0 +1,16 @@
{ mkDerivation, attoparsec, base, mtl, pipes, pipes-bytestring
, stdenv, text
}:
mkDerivation {
pname = "addressbook";
version = "0.1.0.0";
src = ./.;
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
attoparsec base mtl pipes pipes-bytestring text
];
executableHaskellDepends = [ base ];
testHaskellDepends = [ base ];
license = stdenv.lib.licenses.bsd3;
}

15
shell.nix Normal file
View File

@ -0,0 +1,15 @@
with (import <nixpkgs> {});
let addressbook = haskellPackages.callPackage ./. {};
in
mkShell {
name = "addressbook-shell";
buildInputs = [
ghcid
stylish-haskell
haskellPackages.cabal-install
(haskellPackages.ghcWithHoogle (_: addressbook.buildInputs ++ addressbook.propagatedBuildInputs))
];
}

4
src/MyLib.hs Normal file
View File

@ -0,0 +1,4 @@
module MyLib (someFunc) where
someFunc :: IO ()
someFunc = putStrLn "someFunc"

4
test/MyLibTest.hs Normal file
View File

@ -0,0 +1,4 @@
module Main (main) where
main :: IO ()
main = putStrLn "Test suite not yet implemented."