File ghc-declarative.spec of Package ghc-declarative
#
# spec file for package ghc-declarative
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%global pkg_name declarative
%bcond_with tests
Name: ghc-%{pkg_name}
Version: 0.5.1
Release: 0
Summary: DIY Markov Chains
License: MIT
Group: Development/Libraries/Haskell
URL: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-hasty-hamiltonian-devel
BuildRequires: ghc-kan-extensions-devel
BuildRequires: ghc-lens-devel
BuildRequires: ghc-mcmc-types-devel
BuildRequires: ghc-mighty-metropolis-devel
BuildRequires: ghc-mwc-probability-devel
BuildRequires: ghc-pipes-devel
BuildRequires: ghc-primitive-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-speedy-slice-devel
BuildRequires: ghc-transformers-devel
%description
This package presents a simple combinator language for Markov transition
operators that are useful in MCMC.
Any transition operators sharing the same stationary distribution and obeying
the Markov and reversibility properties can be combined in a couple of ways,
such that the resulting operator preserves the stationary distribution and
desirable properties amenable for MCMC.
We can deterministically concatenate operators end-to-end, or sample from a
collection of them according to some probability distribution. See
<http://www.stat.umn.edu/geyer/f05/8931/n1998.pdf Geyer, 2005> for details.
A useful strategy is to hedge one's 'sampling risk' by occasionally
interleaving a computationally-expensive transition (such as a gradient-based
algorithm like Hamiltonian Monte Carlo or NUTS) with cheap Metropolis
transitions.
> transition = frequency [ > (9, metropolis 1.0) > , (1, hamiltonian 0.05 20) >
]
Alternatively: sample consecutively using the same algorithm, but over a range
of different proposal distributions.
> transition = concatAllT [ > slice 0.5 > , slice 1.0 > , slice 2.0 > ]
Or just mix and match and see what happens!
> transition = > sampleT > (sampleT (metropolis 0.5) (slice 0.1)) > (sampleT
(hamiltonian 0.01 20) (metropolis 2.0))
Check the test suite for example usage.
%package devel
Summary: Haskell %{pkg_name} library development files
Group: Development/Libraries/Haskell
Requires: %{name} = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
Requires(postun): ghc-compiler = %{ghc_version}
%description devel
This package provides the Haskell %{pkg_name} library development files.
%prep
%setup -q -n %{pkg_name}-%{version}
%build
%ghc_lib_build
%install
%ghc_lib_install
%check
%cabal_test
%post devel
%ghc_pkg_recache
%postun devel
%ghc_pkg_recache
%files -f %{name}.files
%doc LICENSE
%files devel -f %{name}-devel.files
%changelog