EuroPython 2016
Domen Kožar
twitter.com/iElectric
name: TestPackage
version: 0.1
synopsis: Package with library and two programs
license: BSD3
author: Angela Author
cabal-version: >= 1.2
build-type: Simple
library
build-depends: HUnit
exposed-modules: A, B, C
executable program1
main-is: Main.hs
hs-source-dirs: prog1
other-modules: A, B
build-type: Simple
build-type: Make
build-type: Custom
Name: Test1
Version: 0.0.1
Cabal-Version: >= 1.2
License: BSD3
Author: Jane Doe
Synopsis: Test package to test configurations
Category: Example
Flag Debug
Description: Enable debug support
Default: False
Library
Build-Depends: base > 7
Exposed-Modules: Testing.Test1
Extensions: CPP
if flag(debug)
GHC-Options: -DDEBUG
if !os(windows)
CC-Options: "-DDEBUG"
else
CC-Options: "-DNDEBUG"
x-revision: 2
When you edit cabal file over Hackage interface, following line is added:
http://hackage.haskell.org/package/MonadRandom-0.4/revision/2.cabal
non-feature
http-client >= 0.3.2 && < 0.5,
http-client-tls >= 0.2 && < 0.3,
http-types >= 0.8 && < 0.10
... is a stable source of Haskell packages.
We guarantee that packages build consistently and pass tests before generating nightly and Long Term Support (LTS) releases.
flags: {}
packages:
- '.'
extra-deps: []
resolver: lts-6.7
$ cat stack.yaml
stack init
stack setup
stack new
stack build
stack test
stack bench
fix = f: let self = f self; in self;
d = self: {
foo = "foo"; bar = "bar";
foobar = self.foo + self.bar;
};
(fix d).foobar ≡ "foobar"
Using OO-style inheritance:
extend = rattrs: f: self: let super = rattrs self;
in super // f self super;
override = self: super: { foo = reverse super.foo; };
(fix (extend d override)).foobar ≡ "oofbar"
(fix (extend (extend d override) override)).foobar ≡ "foobar"
fix
(extend
(extend
(extend
(extend haskellPackages commonConfiguration)
compilerConfig)
packageSetConfig)
overrides)
Using OO-style inheritance:
- be more declarative
- be more declarative
- be more declarative
- be more declarative
- be more declarative
- be more declarative
- be more declarative
- be more declarative
- be more declarative
setup.py, setup.cfg, requirements.txt, MANIFEST.in, pyproject.toml, tox.ini
This talk was based on "Peter Simons: Inside of the Nixpkgs Haskell Infrastructure"
http://cryp.to/nixcon-2015-slides.pdf
domen@dev.si