hyphenation 0.6 → 0.7
raw patch · 300 files changed
+345/−77 lines, 300 filesdep −directorydep −filepathdep ~bytestringdep ~doctestbuild-type:Customsetup-changednew-uploaderPVP ok
version bump matches the API change (PVP)
Dependencies removed: directory, filepath
Dependency ranges changed: bytestring, doctest
API changes (from Hackage documentation)
Files
- .travis.yml +85/−23
- CHANGELOG.markdown +9/−0
- LICENSE +1/−5
- Setup.lhs +180/−5
- data/hyph-af.chr.txt.gz binary
- data/hyph-af.hyp.txt.gz binary
- data/hyph-af.lic.txt.gz binary
- data/hyph-af.pat.txt.gz binary
- data/hyph-as.chr.txt.gz binary
- data/hyph-as.hyp.txt.gz binary
- data/hyph-as.lic.txt.gz binary
- data/hyph-as.pat.txt.gz binary
- data/hyph-bg.chr.txt.gz binary
- data/hyph-bg.hyp.txt.gz binary
- data/hyph-bg.lic.txt.gz binary
- data/hyph-bg.pat.txt.gz binary
- data/hyph-bn.chr.txt.gz binary
- data/hyph-bn.hyp.txt.gz binary
- data/hyph-bn.lic.txt.gz binary
- data/hyph-bn.pat.txt.gz binary
- data/hyph-ca.chr.txt.gz binary
- data/hyph-ca.hyp.txt.gz binary
- data/hyph-ca.lic.txt.gz binary
- data/hyph-ca.pat.txt.gz binary
- data/hyph-cop.chr.txt.gz binary
- data/hyph-cop.hyp.txt.gz binary
- data/hyph-cop.lic.txt.gz binary
- data/hyph-cop.pat.txt.gz binary
- data/hyph-cs.chr.txt.gz binary
- data/hyph-cs.hyp.txt.gz binary
- data/hyph-cs.lic.txt.gz binary
- data/hyph-cs.pat.txt.gz binary
- data/hyph-cy.chr.txt.gz binary
- data/hyph-cy.hyp.txt.gz binary
- data/hyph-cy.lic.txt.gz binary
- data/hyph-cy.pat.txt.gz binary
- data/hyph-da.chr.txt.gz binary
- data/hyph-da.hyp.txt.gz binary
- data/hyph-da.lic.txt.gz binary
- data/hyph-da.pat.txt.gz binary
- data/hyph-de-1901.chr.txt.gz binary
- data/hyph-de-1901.hyp.txt.gz binary
- data/hyph-de-1901.lic.txt.gz binary
- data/hyph-de-1901.pat.txt.gz binary
- data/hyph-de-1996.chr.txt.gz binary
- data/hyph-de-1996.hyp.txt.gz binary
- data/hyph-de-1996.lic.txt.gz binary
- data/hyph-de-1996.pat.txt.gz binary
- data/hyph-de-ch-1901.chr.txt.gz binary
- data/hyph-de-ch-1901.hyp.txt.gz binary
- data/hyph-de-ch-1901.lic.txt.gz binary
- data/hyph-de-ch-1901.pat.txt.gz binary
- data/hyph-el-monoton.chr.txt.gz binary
- data/hyph-el-monoton.hyp.txt.gz binary
- data/hyph-el-monoton.lic.txt.gz binary
- data/hyph-el-monoton.pat.txt.gz binary
- data/hyph-el-polyton.chr.txt.gz binary
- data/hyph-el-polyton.hyp.txt.gz binary
- data/hyph-el-polyton.lic.txt.gz binary
- data/hyph-el-polyton.pat.txt.gz binary
- data/hyph-en-gb.chr.txt.gz binary
- data/hyph-en-gb.hyp.txt.gz binary
- data/hyph-en-gb.lic.txt.gz binary
- data/hyph-en-gb.pat.txt.gz binary
- data/hyph-en-us.chr.txt.gz binary
- data/hyph-en-us.hyp.txt.gz binary
- data/hyph-en-us.lic.txt.gz binary
- data/hyph-en-us.pat.txt.gz binary
- data/hyph-eo.chr.txt.gz binary
- data/hyph-eo.hyp.txt.gz binary
- data/hyph-eo.lic.txt.gz binary
- data/hyph-eo.pat.txt.gz binary
- data/hyph-es.chr.txt.gz binary
- data/hyph-es.hyp.txt.gz binary
- data/hyph-es.lic.txt.gz binary
- data/hyph-es.pat.txt.gz binary
- data/hyph-et.chr.txt.gz binary
- data/hyph-et.hyp.txt.gz binary
- data/hyph-et.lic.txt.gz binary
- data/hyph-et.pat.txt.gz binary
- data/hyph-eu.chr.txt.gz binary
- data/hyph-eu.hyp.txt.gz binary
- data/hyph-eu.lic.txt.gz binary
- data/hyph-eu.pat.txt.gz binary
- data/hyph-fi.chr.txt.gz binary
- data/hyph-fi.hyp.txt.gz binary
- data/hyph-fi.lic.txt.gz binary
- data/hyph-fi.pat.txt.gz binary
- data/hyph-fr.chr.txt.gz binary
- data/hyph-fr.hyp.txt.gz binary
- data/hyph-fr.lic.txt.gz binary
- data/hyph-fr.pat.txt.gz binary
- data/hyph-fur.chr.txt.gz binary
- data/hyph-fur.hyp.txt.gz binary
- data/hyph-fur.lic.txt.gz binary
- data/hyph-fur.pat.txt.gz binary
- data/hyph-ga.chr.txt.gz binary
- data/hyph-ga.hyp.txt.gz binary
- data/hyph-ga.lic.txt.gz binary
- data/hyph-ga.pat.txt.gz binary
- data/hyph-gl.chr.txt.gz binary
- data/hyph-gl.hyp.txt.gz binary
- data/hyph-gl.lic.txt.gz binary
- data/hyph-gl.pat.txt.gz binary
- data/hyph-grc.chr.txt.gz binary
- data/hyph-grc.hyp.txt.gz binary
- data/hyph-grc.lic.txt.gz binary
- data/hyph-grc.pat.txt.gz binary
- data/hyph-gu.chr.txt.gz binary
- data/hyph-gu.hyp.txt.gz binary
- data/hyph-gu.lic.txt.gz binary
- data/hyph-gu.pat.txt.gz binary
- data/hyph-hi.chr.txt.gz binary
- data/hyph-hi.hyp.txt.gz binary
- data/hyph-hi.lic.txt.gz binary
- data/hyph-hi.pat.txt.gz binary
- data/hyph-hr.chr.txt.gz binary
- data/hyph-hr.hyp.txt.gz binary
- data/hyph-hr.lic.txt.gz binary
- data/hyph-hr.pat.txt.gz binary
- data/hyph-hsb.chr.txt.gz binary
- data/hyph-hsb.hyp.txt.gz binary
- data/hyph-hsb.lic.txt.gz binary
- data/hyph-hsb.pat.txt.gz binary
- data/hyph-hu.chr.txt.gz binary
- data/hyph-hu.hyp.txt.gz binary
- data/hyph-hu.lic.txt.gz binary
- data/hyph-hu.pat.txt.gz binary
- data/hyph-hy.chr.txt.gz binary
- data/hyph-hy.hyp.txt.gz binary
- data/hyph-hy.lic.txt.gz binary
- data/hyph-hy.pat.txt.gz binary
- data/hyph-ia.chr.txt.gz binary
- data/hyph-ia.hyp.txt.gz binary
- data/hyph-ia.lic.txt.gz binary
- data/hyph-ia.pat.txt.gz binary
- data/hyph-id.chr.txt.gz binary
- data/hyph-id.hyp.txt.gz binary
- data/hyph-id.lic.txt.gz binary
- data/hyph-id.pat.txt.gz binary
- data/hyph-is.chr.txt.gz binary
- data/hyph-is.hyp.txt.gz binary
- data/hyph-is.lic.txt.gz binary
- data/hyph-is.pat.txt.gz binary
- data/hyph-it.chr.txt.gz binary
- data/hyph-it.hyp.txt.gz binary
- data/hyph-it.lic.txt.gz binary
- data/hyph-it.pat.txt.gz binary
- data/hyph-ka.chr.txt.gz binary
- data/hyph-ka.hyp.txt.gz binary
- data/hyph-ka.lic.txt.gz binary
- data/hyph-ka.pat.txt.gz binary
- data/hyph-kmr.chr.txt.gz binary
- data/hyph-kmr.hyp.txt.gz binary
- data/hyph-kmr.lic.txt.gz binary
- data/hyph-kmr.pat.txt.gz binary
- data/hyph-kn.chr.txt.gz binary
- data/hyph-kn.hyp.txt.gz binary
- data/hyph-kn.lic.txt.gz binary
- data/hyph-kn.pat.txt.gz binary
- data/hyph-la-x-classic.chr.txt.gz binary
- data/hyph-la-x-classic.hyp.txt.gz binary
- data/hyph-la-x-classic.lic.txt.gz binary
- data/hyph-la-x-classic.pat.txt.gz binary
- data/hyph-la.chr.txt.gz binary
- data/hyph-la.hyp.txt.gz binary
- data/hyph-la.lic.txt.gz binary
- data/hyph-la.pat.txt.gz binary
- data/hyph-lo.chr.txt.gz binary
- data/hyph-lo.hyp.txt.gz binary
- data/hyph-lo.lic.txt.gz binary
- data/hyph-lo.pat.txt.gz binary
- data/hyph-lt.chr.txt.gz binary
- data/hyph-lt.hyp.txt.gz binary
- data/hyph-lt.lic.txt.gz binary
- data/hyph-lt.pat.txt.gz binary
- data/hyph-lv.chr.txt.gz binary
- data/hyph-lv.hyp.txt.gz binary
- data/hyph-lv.lic.txt.gz binary
- data/hyph-lv.pat.txt.gz binary
- data/hyph-ml.chr.txt.gz binary
- data/hyph-ml.hyp.txt.gz binary
- data/hyph-ml.lic.txt.gz binary
- data/hyph-ml.pat.txt.gz binary
- data/hyph-mn-cyrl.chr.txt.gz binary
- data/hyph-mn-cyrl.hyp.txt.gz binary
- data/hyph-mn-cyrl.lic.txt.gz binary
- data/hyph-mn-cyrl.pat.txt.gz binary
- data/hyph-mr.chr.txt.gz binary
- data/hyph-mr.hyp.txt.gz binary
- data/hyph-mr.lic.txt.gz binary
- data/hyph-mr.pat.txt.gz binary
- data/hyph-mul-ethi.chr.txt.gz binary
- data/hyph-mul-ethi.hyp.txt.gz binary
- data/hyph-mul-ethi.lic.txt.gz binary
- data/hyph-mul-ethi.pat.txt.gz binary
- data/hyph-nb.chr.txt.gz binary
- data/hyph-nb.hyp.txt.gz binary
- data/hyph-nb.lic.txt.gz binary
- data/hyph-nb.pat.txt.gz binary
- data/hyph-nl.chr.txt.gz binary
- data/hyph-nl.hyp.txt.gz binary
- data/hyph-nl.lic.txt.gz binary
- data/hyph-nl.pat.txt.gz binary
- data/hyph-nn.chr.txt.gz binary
- data/hyph-nn.hyp.txt.gz binary
- data/hyph-nn.lic.txt.gz binary
- data/hyph-nn.pat.txt.gz binary
- data/hyph-or.chr.txt.gz binary
- data/hyph-or.hyp.txt.gz binary
- data/hyph-or.lic.txt.gz binary
- data/hyph-or.pat.txt.gz binary
- data/hyph-pa.chr.txt.gz binary
- data/hyph-pa.hyp.txt.gz binary
- data/hyph-pa.lic.txt.gz binary
- data/hyph-pa.pat.txt.gz binary
- data/hyph-pl.chr.txt.gz binary
- data/hyph-pl.hyp.txt.gz binary
- data/hyph-pl.lic.txt.gz binary
- data/hyph-pl.pat.txt.gz binary
- data/hyph-pms.chr.txt.gz binary
- data/hyph-pms.hyp.txt.gz binary
- data/hyph-pms.lic.txt.gz binary
- data/hyph-pms.pat.txt.gz binary
- data/hyph-pt.chr.txt.gz binary
- data/hyph-pt.hyp.txt.gz binary
- data/hyph-pt.lic.txt.gz binary
- data/hyph-pt.pat.txt.gz binary
- data/hyph-rm.chr.txt.gz binary
- data/hyph-rm.hyp.txt.gz binary
- data/hyph-rm.lic.txt.gz binary
- data/hyph-rm.pat.txt.gz binary
- data/hyph-ro.chr.txt.gz binary
- data/hyph-ro.hyp.txt.gz binary
- data/hyph-ro.lic.txt.gz binary
- data/hyph-ro.pat.txt.gz binary
- data/hyph-ru.chr.txt.gz binary
- data/hyph-ru.hyp.txt.gz binary
- data/hyph-ru.lic.txt.gz binary
- data/hyph-ru.pat.txt.gz binary
- data/hyph-sa.chr.txt.gz binary
- data/hyph-sa.hyp.txt.gz binary
- data/hyph-sa.lic.txt.gz binary
- data/hyph-sa.pat.txt.gz binary
- data/hyph-sh-cyrl.chr.txt.gz binary
- data/hyph-sh-cyrl.hyp.txt.gz binary
- data/hyph-sh-cyrl.lic.txt.gz binary
- data/hyph-sh-cyrl.pat.txt.gz binary
- data/hyph-sh-latn.chr.txt.gz binary
- data/hyph-sh-latn.hyp.txt.gz binary
- data/hyph-sh-latn.lic.txt.gz binary
- data/hyph-sh-latn.pat.txt.gz binary
- data/hyph-sk.chr.txt.gz binary
- data/hyph-sk.hyp.txt.gz binary
- data/hyph-sk.lic.txt.gz binary
- data/hyph-sk.pat.txt.gz binary
- data/hyph-sl.chr.txt.gz binary
- data/hyph-sl.hyp.txt.gz binary
- data/hyph-sl.lic.txt.gz binary
- data/hyph-sl.pat.txt.gz binary
- data/hyph-sr-cyrl.chr.txt.gz binary
- data/hyph-sr-cyrl.hyp.txt.gz binary
- data/hyph-sr-cyrl.lic.txt.gz binary
- data/hyph-sr-cyrl.pat.txt.gz binary
- data/hyph-sv.chr.txt.gz binary
- data/hyph-sv.hyp.txt.gz binary
- data/hyph-sv.lic.txt.gz binary
- data/hyph-sv.pat.txt.gz binary
- data/hyph-ta.chr.txt.gz binary
- data/hyph-ta.hyp.txt.gz binary
- data/hyph-ta.lic.txt.gz binary
- data/hyph-ta.pat.txt.gz binary
- data/hyph-te.chr.txt.gz binary
- data/hyph-te.hyp.txt.gz binary
- data/hyph-te.lic.txt.gz binary
- data/hyph-te.pat.txt.gz binary
- data/hyph-th.chr.txt.gz binary
- data/hyph-th.hyp.txt.gz binary
- data/hyph-th.lic.txt.gz binary
- data/hyph-th.pat.txt.gz binary
- data/hyph-tk.chr.txt.gz binary
- data/hyph-tk.hyp.txt.gz binary
- data/hyph-tk.lic.txt.gz binary
- data/hyph-tk.pat.txt.gz binary
- data/hyph-tr.chr.txt.gz binary
- data/hyph-tr.hyp.txt.gz binary
- data/hyph-tr.lic.txt.gz binary
- data/hyph-tr.pat.txt.gz binary
- data/hyph-uk.chr.txt.gz binary
- data/hyph-uk.hyp.txt.gz binary
- data/hyph-uk.lic.txt.gz binary
- data/hyph-uk.pat.txt.gz binary
- data/hyph-zh-latn-pinyin.chr.txt.gz binary
- data/hyph-zh-latn-pinyin.hyp.txt.gz binary
- data/hyph-zh-latn-pinyin.lic.txt.gz binary
- data/hyph-zh-latn-pinyin.pat.txt.gz binary
- hyphenation.cabal +14/−9
- src/Text/Hyphenation/ByteStringLazyCompat.hs +32/−0
- src/Text/Hyphenation/Language.hs +5/−10
- tests/doctests.hs +19/−25
@@ -1,47 +1,107 @@-# NB: don't set `language: haskell` here+# This file has been generated -- see https://github.com/hvr/multi-ghc-travis+language: c+sudo: false -# See also https://github.com/hvr/multi-ghc-travis for more information-env:- # we have to use CABALVER=1.16 for GHC<7.6 as well, as there's- # no package for earlier cabal versions in the PPA- - GHCVER=7.4.2 CABALVER=1.16- - GHCVER=7.6.3 CABALVER=1.16- - GHCVER=7.8.4 CABALVER=1.18- - GHCVER=7.10.1 CABALVER=1.22- - GHCVER=head CABALVER=1.22+cache:+ directories:+ - $HOME/.cabsnap+ - $HOME/.cabal/packages +before_cache:+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar+ matrix:+ include:+ - env: CABALVER=1.24 GHCVER=7.0.4+ compiler: ": #GHC 7.0.4"+ addons: {apt: {packages: [cabal-install-1.24,ghc-7.0.4,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.24 GHCVER=7.2.2+ compiler: ": #GHC 7.2.2"+ addons: {apt: {packages: [cabal-install-1.24,ghc-7.2.2,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.24 GHCVER=7.4.2+ compiler: ": #GHC 7.4.2"+ addons: {apt: {packages: [cabal-install-1.24,ghc-7.4.2,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.24 GHCVER=7.6.3+ compiler: ": #GHC 7.6.3"+ addons: {apt: {packages: [cabal-install-1.24,ghc-7.6.3,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.24 GHCVER=7.8.4+ compiler: ": #GHC 7.8.4"+ addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.4,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.24 GHCVER=7.10.3+ compiler: ": #GHC 7.10.3"+ addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.3,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.24 GHCVER=8.0.2+ compiler: ": #GHC 8.0.2"+ addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.24 GHCVER=8.2.1+ compiler: ": #GHC 8.2.1"+ addons: {apt: {packages: [cabal-install-1.24,ghc-8.2.1,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.24 GHCVER=head+ compiler: ": #GHC head"+ addons: {apt: {packages: [cabal-install-1.24,ghc-head,hlint], sources: [hvr-ghc]}}+ allow_failures:- - env: GHCVER=head CABALVER=1.22+ - env: CABALVER=1.24 GHCVER=7.0.4+ - env: CABALVER=1.24 GHCVER=7.2.2+ - env: CABALVER=1.24 GHCVER=head -# Note: the distinction between `before_install` and `install` is not-# important. before_install:- - travis_retry sudo add-apt-repository -y ppa:hvr/ghc- - travis_retry sudo apt-get update- - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER- - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH- - cabal --version+ - unset CC+ - export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH install:- - travis_retry cabal update- - cabal install --only-dependencies- - travis_retry sudo apt-get -q -y install hlint || cabal install hlint+ - cabal --version+ - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"+ - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];+ then+ zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >+ $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;+ fi+ - travis_retry cabal update -v+ - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config+ - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt+ - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt +# check whether current requested install-plan matches cached package-db snapshot+ - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;+ then+ echo "cabal build-cache HIT";+ rm -rfv .ghc;+ cp -a $HOME/.cabsnap/ghc $HOME/.ghc;+ cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;+ else+ echo "cabal build-cache MISS";+ rm -rf $HOME/.cabsnap;+ mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;+ cabal install -j --only-dependencies --enable-tests --enable-benchmarks;+ fi++# snapshot package-db on cache miss+ - if [ ! -d $HOME/.cabsnap ];+ then+ echo "snapshotting package-db to build-cache";+ mkdir $HOME/.cabsnap;+ cp -a $HOME/.ghc $HOME/.cabsnap/ghc;+ cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;+ fi+ # Here starts the actual work to be performed for the package under # test; any command which exits with a non-zero exit code causes the # build to fail. script: # -v2 provides useful information for debugging- - cabal configure -v2+ - cabal configure --enable-tests --enable-benchmarks -v2 # this builds all libraries and executables # (including tests/benchmarks) - cabal build + - cabal test+ - hlint src --cpp-define HLINT+ # tests that a source-distribution can be generated - cabal sdist- - hlint src --cpp-define HLINT # check that the generated source-distribution can be built & installed - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;@@ -60,3 +120,5 @@ skip_join: true template: - "\x0313hyphenation\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"++# EOF
@@ -1,3 +1,12 @@+0.7+---+* Updated Spanish and Thai hyphenation patterns.+* Removed Lao patterns until higher quality patterns are available.+* Updated the licenses associated with many patterns+* Revamp `Setup.hs` to use `cabal-doctest`. This makes it build+ with `Cabal-2.0`, and makes the `doctest`s work with `cabal new-build` and+ sandboxes.+ 0.6 --- * Applied `gzip` to the internal data files. This shrinks the resulting library and any statically linked executable by about a meg and a half.
@@ -1,4 +1,4 @@-Copyright 2012-2015 Edward Kmett+Copyright 2012-2016 Edward Kmett All rights reserved. @@ -12,10 +12,6 @@ 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 AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -1,7 +1,182 @@-#!/usr/bin/runhaskell-> module Main (main) where+\begin{code}+{-# LANGUAGE CPP #-}+{-# LANGUAGE OverloadedStrings #-}+module Main (main) where -> import Distribution.Simple+#ifndef MIN_VERSION_cabal_doctest+#define MIN_VERSION_cabal_doctest(x,y,z) 0+#endif -> main :: IO ()-> main = defaultMain++#if MIN_VERSION_cabal_doctest(1,0,0)+import Distribution.Extra.Doctest ( defaultMainWithDoctests )+#else++-- Otherwise we provide a shim++#ifndef MIN_VERSION_Cabal+#define MIN_VERSION_Cabal(x,y,z) 0+#endif+#ifndef MIN_VERSION_directory+#define MIN_VERSION_directory(x,y,z) 0+#endif+#if MIN_VERSION_Cabal(1,24,0)+#define InstalledPackageId UnitId+#endif++import Control.Monad ( when )+import Data.List ( nub )+import Data.String ( fromString )+import Distribution.Package ( InstalledPackageId )+import Distribution.Package ( PackageId, Package (..), packageVersion )+import Distribution.PackageDescription ( PackageDescription(), TestSuite(..) , Library (..), BuildInfo (..))+import Distribution.Simple ( defaultMainWithHooks, UserHooks(..), simpleUserHooks )+import Distribution.Simple.Utils ( rewriteFile, createDirectoryIfMissingVerbose )+import Distribution.Simple.BuildPaths ( autogenModulesDir )+import Distribution.Simple.Setup ( BuildFlags(buildDistPref, buildVerbosity), fromFlag)+import Distribution.Simple.LocalBuildInfo ( withPackageDB, withLibLBI, withTestLBI, LocalBuildInfo(), ComponentLocalBuildInfo(componentPackageDeps), compiler )+import Distribution.Simple.Compiler ( showCompilerId , PackageDB (..))+import Distribution.Text ( display , simpleParse )+import System.FilePath ( (</>) )++#if MIN_VERSION_Cabal(1,25,0)+import Distribution.Simple.BuildPaths ( autogenComponentModulesDir )+#endif++#if MIN_VERSION_directory(1,2,2)+import System.Directory (makeAbsolute)+#else+import System.Directory (getCurrentDirectory)+import System.FilePath (isAbsolute)++makeAbsolute :: FilePath -> IO FilePath+makeAbsolute p | isAbsolute p = return p+ | otherwise = do+ cwd <- getCurrentDirectory+ return $ cwd </> p+#endif++generateBuildModule :: String -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()+generateBuildModule testsuiteName flags pkg lbi = do+ let verbosity = fromFlag (buildVerbosity flags)+ let distPref = fromFlag (buildDistPref flags)++ -- Package DBs+ let dbStack = withPackageDB lbi ++ [ SpecificPackageDB $ distPref </> "package.conf.inplace" ]+ let dbFlags = "-hide-all-packages" : packageDbArgs dbStack++ withLibLBI pkg lbi $ \lib libcfg -> do+ let libBI = libBuildInfo lib++ -- modules+ let modules = exposedModules lib ++ otherModules libBI+ -- it seems that doctest is happy to take in module names, not actual files!+ let module_sources = modules++ -- We need the directory with library's cabal_macros.h!+#if MIN_VERSION_Cabal(1,25,0)+ let libAutogenDir = autogenComponentModulesDir lbi libcfg+#else+ let libAutogenDir = autogenModulesDir lbi+#endif++ -- Lib sources and includes+ iArgs <- mapM (fmap ("-i"++) . makeAbsolute) $ libAutogenDir : hsSourceDirs libBI+ includeArgs <- mapM (fmap ("-I"++) . makeAbsolute) $ includeDirs libBI++ -- CPP includes, i.e. include cabal_macros.h+ let cppFlags = map ("-optP"++) $+ [ "-include", libAutogenDir ++ "/cabal_macros.h" ]+ ++ cppOptions libBI++ withTestLBI pkg lbi $ \suite suitecfg -> when (testName suite == fromString testsuiteName) $ do++ -- get and create autogen dir+#if MIN_VERSION_Cabal(1,25,0)+ let testAutogenDir = autogenComponentModulesDir lbi suitecfg+#else+ let testAutogenDir = autogenModulesDir lbi+#endif+ createDirectoryIfMissingVerbose verbosity True testAutogenDir++ -- write autogen'd file+ rewriteFile (testAutogenDir </> "Build_doctests.hs") $ unlines+ [ "module Build_doctests where"+ , ""+ -- -package-id etc. flags+ , "pkgs :: [String]"+ , "pkgs = " ++ (show $ formatDeps $ testDeps libcfg suitecfg)+ , ""+ , "flags :: [String]"+ , "flags = " ++ show (iArgs ++ includeArgs ++ dbFlags ++ cppFlags)+ , ""+ , "module_sources :: [String]"+ , "module_sources = " ++ show (map display module_sources)+ ]+ where+ -- we do this check in Setup, as then doctests don't need to depend on Cabal+ isOldCompiler = maybe False id $ do+ a <- simpleParse $ showCompilerId $ compiler lbi+ b <- simpleParse "7.5"+ return $ packageVersion (a :: PackageId) < b++ formatDeps = map formatOne+ formatOne (installedPkgId, pkgId)+ -- The problem is how different cabal executables handle package databases+ -- when doctests depend on the library+ | packageId pkg == pkgId = "-package=" ++ display pkgId+ | otherwise = "-package-id=" ++ display installedPkgId++ -- From Distribution.Simple.Program.GHC+ packageDbArgs :: [PackageDB] -> [String]+ packageDbArgs | isOldCompiler = packageDbArgsConf+ | otherwise = packageDbArgsDb++ -- GHC <7.6 uses '-package-conf' instead of '-package-db'.+ packageDbArgsConf :: [PackageDB] -> [String]+ packageDbArgsConf dbstack = case dbstack of+ (GlobalPackageDB:UserPackageDB:dbs) -> concatMap specific dbs+ (GlobalPackageDB:dbs) -> ("-no-user-package-conf")+ : concatMap specific dbs+ _ -> ierror+ where+ specific (SpecificPackageDB db) = [ "-package-conf=" ++ db ]+ specific _ = ierror+ ierror = error $ "internal error: unexpected package db stack: "+ ++ show dbstack++ -- GHC >= 7.6 uses the '-package-db' flag. See+ -- https://ghc.haskell.org/trac/ghc/ticket/5977.+ packageDbArgsDb :: [PackageDB] -> [String]+ -- special cases to make arguments prettier in common scenarios+ packageDbArgsDb dbstack = case dbstack of+ (GlobalPackageDB:UserPackageDB:dbs)+ | all isSpecific dbs -> concatMap single dbs+ (GlobalPackageDB:dbs)+ | all isSpecific dbs -> "-no-user-package-db"+ : concatMap single dbs+ dbs -> "-clear-package-db"+ : concatMap single dbs+ where+ single (SpecificPackageDB db) = [ "-package-db=" ++ db ]+ single GlobalPackageDB = [ "-global-package-db" ]+ single UserPackageDB = [ "-user-package-db" ]+ isSpecific (SpecificPackageDB _) = True+ isSpecific _ = False++testDeps :: ComponentLocalBuildInfo -> ComponentLocalBuildInfo -> [(InstalledPackageId, PackageId)]+testDeps xs ys = nub $ componentPackageDeps xs ++ componentPackageDeps ys++defaultMainWithDoctests :: String -> IO ()+defaultMainWithDoctests testSuiteName = defaultMainWithHooks simpleUserHooks+ { buildHook = \pkg lbi hooks flags -> do+ generateBuildModule testSuiteName flags pkg lbi+ buildHook simpleUserHooks pkg lbi hooks flags+ }++#endif++main :: IO ()+main = defaultMainWithDoctests "doctests"++\end{code}
binary file changed (163 → 163 bytes)
binary file changed (1407 → 1407 bytes)
binary file changed (576 → 576 bytes)
binary file changed (36758 → 36758 bytes)
binary file changed (181 → 181 bytes)
binary file changed (36 → 36 bytes)
binary file changed (628 → 628 bytes)
binary file changed (198 → 198 bytes)
binary file changed (144 → 144 bytes)
binary file changed (36 → 36 bytes)
binary file changed (824 → 824 bytes)
binary file changed (3512 → 3512 bytes)
binary file changed (181 → 181 bytes)
binary file changed (36 → 36 bytes)
binary file changed (628 → 628 bytes)
binary file changed (198 → 198 bytes)
binary file changed (149 → 149 bytes)
binary file changed (149 → 149 bytes)
binary file changed (2408 → 2404 bytes)
binary file changed (1993 → 1993 bytes)
binary file changed (175 → 175 bytes)
binary file changed (37 → 37 bytes)
binary file changed (1751 → 1751 bytes)
binary file changed (1520 → 1520 bytes)
binary file changed (176 → 176 bytes)
binary file changed (92 → 92 bytes)
binary file changed (1905 → 1900 bytes)
binary file changed (10869 → 10869 bytes)
binary file changed (131 → 131 bytes)
binary file changed (36 → 36 bytes)
binary file changed (558 → 558 bytes)
binary file changed (20704 → 20704 bytes)
binary file changed (126 → 126 bytes)
binary file changed (36 → 36 bytes)
binary file changed (1658 → 1655 bytes)
binary file changed (3293 → 3293 bytes)
binary file changed (179 → 179 bytes)
binary file changed (41 → 41 bytes)
binary file changed (596 → 596 bytes)
binary file changed (50233 → 50233 bytes)
binary file changed (179 → 179 bytes)
binary file changed (41 → 41 bytes)
binary file changed (606 → 606 bytes)
binary file changed (48744 → 48744 bytes)
binary file changed (182 → 182 bytes)
binary file changed (44 → 44 bytes)
binary file changed (615 → 615 bytes)
binary file changed (49347 → 49347 bytes)
binary file changed (237 → 237 bytes)
binary file changed (44 → 44 bytes)
binary file changed (764 → 764 bytes)
binary file changed (1431 → 1431 bytes)
binary file changed (669 → 669 bytes)
binary file changed (44 → 44 bytes)
binary file changed (799 → 799 bytes)
binary file changed (3612 → 3612 bytes)
binary file changed (108 → 108 bytes)
binary file changed (109 → 109 bytes)
binary file changed (1199 → 1199 bytes)
binary file changed (27795 → 27795 bytes)
binary file changed (108 → 108 bytes)
binary file changed (141 → 141 bytes)
binary file changed (937 → 937 bytes)
binary file changed (16804 → 16804 bytes)
binary file changed (131 → 131 bytes)
binary file changed (36 → 36 bytes)
binary file changed (738 → 738 bytes)
binary file changed (6501 → 6501 bytes)
binary file changed (140 → 140 bytes)
binary file changed (36 → 36 bytes)
binary file changed (434 → 994 bytes)
binary file changed (9048 → 9679 bytes)
binary file changed (132 → 132 bytes)
binary file changed (36 → 36 bytes)
binary file changed (1719 → 1715 bytes)
binary file changed (11662 → 11662 bytes)
binary file changed (114 → 114 bytes)
binary file changed (36 → 36 bytes)
binary file changed (985 → 985 bytes)
binary file changed (415 → 415 bytes)
binary file changed (115 → 115 bytes)
binary file changed (36 → 36 bytes)
binary file changed (1669 → 1665 bytes)
binary file changed (727 → 727 bytes)
binary file changed (163 → 163 bytes)
binary file changed (36 → 36 bytes)
binary file changed (2347 → 2342 bytes)
binary file changed (3856 → 3856 bytes)
binary file changed (129 → 129 bytes)
binary file changed (37 → 37 bytes)
binary file changed (834 → 834 bytes)
binary file changed (1092 → 1092 bytes)
binary file changed (131 → 131 bytes)
binary file changed (206 → 206 bytes)
binary file changed (2045 → 2042 bytes)
binary file changed (20143 → 20143 bytes)
binary file changed (140 → 140 bytes)
binary file changed (36 → 36 bytes)
binary file changed (401 → 401 bytes)
binary file changed (5987 → 5987 bytes)
binary file changed (662 → 662 bytes)
binary file changed (37 → 37 bytes)
binary file changed (858 → 858 bytes)
binary file changed (13881 → 13881 bytes)
binary file changed (173 → 173 bytes)
binary file changed (36 → 36 bytes)
binary file changed (630 → 630 bytes)
binary file changed (184 → 184 bytes)
binary file changed (183 → 183 bytes)
binary file changed (36 → 36 bytes)
binary file changed (627 → 627 bytes)
binary file changed (189 → 189 bytes)
binary file changed (128 → 128 bytes)
binary file changed (36 → 36 bytes)
binary file changed (498 → 498 bytes)
binary file changed (3366 → 3366 bytes)
binary file changed (150 → 150 bytes)
binary file changed (184 → 184 bytes)
binary file changed (1706 → 1702 bytes)
binary file changed (3749 → 3749 bytes)
binary file changed (156 → 156 bytes)
binary file changed (36 → 36 bytes)
binary file changed (934 → 934 bytes)
binary file changed (198053 → 198053 bytes)
binary file changed (163 → 163 bytes)
binary file changed (36 → 36 bytes)
binary file changed (523 → 523 bytes)
binary file changed (2743 → 2743 bytes)
binary file changed (105 → 105 bytes)
binary file changed (97 → 97 bytes)
binary file changed (1857 → 1854 bytes)
binary file changed (1666 → 1666 bytes)
binary file changed (104 → 104 bytes)
binary file changed (225 → 225 bytes)
binary file changed (1950 → 1945 bytes)
binary file changed (361 → 361 bytes)
binary file changed (156 → 156 bytes)
binary file changed (36 → 36 bytes)
binary file changed (1720 → 1714 bytes)
binary file changed (13482 → 13482 bytes)
binary file changed (120 → 120 bytes)
binary file changed (36 → 36 bytes)
binary file changed (849 → 849 bytes)
binary file changed (949 → 949 bytes)
binary file changed (115 → 115 bytes)
binary file changed (36 → 36 bytes)
binary file changed (595 → 595 bytes)
binary file changed (6292 → 6292 bytes)
binary file changed (141 → 141 bytes)
binary file changed (37 → 37 bytes)
binary file changed (605 → 605 bytes)
binary file changed (799 → 799 bytes)
binary file changed (190 → 190 bytes)
binary file changed (36 → 36 bytes)
binary file changed (628 → 628 bytes)
binary file changed (193 → 193 bytes)
binary file changed (109 → 109 bytes)
binary file changed (46 → 46 bytes)
binary file changed (648 → 648 bytes)
binary file changed (2057 → 2057 bytes)
binary file changed (119 → 119 bytes)
binary file changed (36 → 36 bytes)
binary file changed (2364 → 2364 bytes)
binary file changed (777 → 777 bytes)
binary file changed (145 → absent bytes)
binary file changed (36 → absent bytes)
binary file changed (494 → absent bytes)
binary file changed (2167 → absent bytes)
binary file changed (145 → 145 bytes)
binary file changed (36 → 36 bytes)
binary file changed (976 → 976 bytes)
binary file changed (4166 → 4166 bytes)
binary file changed (148 → 148 bytes)
binary file changed (36 → 36 bytes)
binary file changed (424 → 424 bytes)
binary file changed (32362 → 32362 bytes)
binary file changed (196 → 196 bytes)
binary file changed (36 → 36 bytes)
binary file changed (631 → 631 bytes)
binary file changed (239 → 239 bytes)
binary file changed (166 → 166 bytes)
binary file changed (41 → 41 bytes)
binary file changed (1953 → 1948 bytes)
binary file changed (2863 → 2863 bytes)
binary file changed (183 → 183 bytes)
binary file changed (36 → 36 bytes)
binary file changed (629 → 629 bytes)
binary file changed (189 → 189 bytes)
binary file changed (732 → 732 bytes)
binary file changed (42 → 42 bytes)
binary file changed (651 → 651 bytes)
binary file changed (797 → 797 bytes)
binary file changed (145 → 145 bytes)
binary file changed (53 → 53 bytes)
binary file changed (600 → 600 bytes)
binary file changed (94017 → 94017 bytes)
binary file changed (156 → 156 bytes)
binary file changed (292 → 292 bytes)
binary file changed (2133 → 2131 bytes)
binary file changed (40068 → 40068 bytes)
binary file changed (145 → 145 bytes)
binary file changed (53 → 53 bytes)
binary file changed (602 → 602 bytes)
binary file changed (94017 → 94017 bytes)
binary file changed (172 → 172 bytes)
binary file changed (36 → 36 bytes)
binary file changed (627 → 627 bytes)
binary file changed (182 → 182 bytes)
binary file changed (163 → 163 bytes)
binary file changed (36 → 36 bytes)
binary file changed (629 → 629 bytes)
binary file changed (172 → 172 bytes)
binary file changed (145 → 145 bytes)
binary file changed (164 → 164 bytes)
binary file changed (1899 → 1896 bytes)
binary file changed (10963 → 10963 bytes)
binary file changed (121 → 121 bytes)
binary file changed (37 → 37 bytes)
binary file changed (780 → 780 bytes)
binary file changed (949 → 949 bytes)
binary file changed (156 → 156 bytes)
binary file changed (51 → 51 bytes)
binary file changed (1828 → 1826 bytes)
binary file changed (648 → 648 bytes)
binary file changed (120 → 120 bytes)
binary file changed (36 → 36 bytes)
binary file changed (905 → 905 bytes)
binary file changed (1012 → 1012 bytes)
binary file changed (126 → 126 bytes)
binary file changed (36 → 36 bytes)
binary file changed (2178 → 2174 bytes)
binary file changed (1852 → 1852 bytes)
binary file changed (158 → 158 bytes)
binary file changed (1142 → 1142 bytes)
binary file changed (1731 → 1727 bytes)
binary file changed (22289 → 22289 bytes)
binary file changed (1053 → 1053 bytes)
binary file changed (36 → 36 bytes)
binary file changed (425 → 425 bytes)
binary file changed (1823 → 1823 bytes)
binary file changed (145 → 145 bytes)
binary file changed (453 → 453 bytes)
binary file changed (1114 → 1114 bytes)
binary file changed (7957 → 7957 bytes)
binary file changed (133 → 133 bytes)
binary file changed (364 → 364 bytes)
binary file changed (1113 → 1113 bytes)
binary file changed (6957 → 6957 bytes)
binary file changed (179 → 179 bytes)
binary file changed (84 → 84 bytes)
binary file changed (1912 → 1908 bytes)
binary file changed (7226 → 7226 bytes)
binary file changed (126 → 126 bytes)
binary file changed (36 → 36 bytes)
binary file changed (1922 → 1918 bytes)
binary file changed (3229 → 3229 bytes)
binary file changed (145 → 145 bytes)
binary file changed (538 → 538 bytes)
binary file changed (1734 → 1734 bytes)
binary file changed (7421 → 7421 bytes)
binary file changed (131 → 131 bytes)
binary file changed (36 → 36 bytes)
binary file changed (2380 → 2375 bytes)
binary file changed (15006 → 15006 bytes)
binary file changed (152 → 152 bytes)
binary file changed (36 → 36 bytes)
binary file changed (627 → 627 bytes)
binary file changed (200 → 200 bytes)
binary file changed (188 → 188 bytes)
binary file changed (36 → 36 bytes)
binary file changed (628 → 628 bytes)
binary file changed (191 → 191 bytes)
binary file changed (181 → 181 bytes)
binary file changed (36 → 36 bytes)
binary file changed (441 → 441 bytes)
binary file changed (15299 → 15306 bytes)
binary file changed (144 → 144 bytes)
binary file changed (36 → 36 bytes)
binary file changed (341 → 341 bytes)
binary file changed (5441 → 5441 bytes)
binary file changed (146 → 146 bytes)
binary file changed (36 → 36 bytes)
binary file changed (913 → 911 bytes)
binary file changed (1246 → 1246 bytes)
binary file changed (173 → 173 bytes)
binary file changed (36 → 36 bytes)
binary file changed (1586 → 1584 bytes)
binary file changed (13470 → 13470 bytes)
binary file changed (137 → 137 bytes)
binary file changed (48 → 48 bytes)
binary file changed (1906 → 1902 bytes)
binary file changed (400 → 400 bytes)
@@ -1,6 +1,6 @@ name: hyphenation category: Text-version: 0.6+version: 0.7 license: BSD3 cabal-version: >= 1.8 license-file: LICENSE@@ -9,9 +9,9 @@ stability: provisional homepage: http://github.com/ekmett/hyphenation bug-reports: http://github.com/ekmett/hyphenation/issues-copyright: (C) 2012-2015 Edward A. Kmett+copyright: (C) 2012-2016 Edward A. Kmett synopsis: Configurable Knuth-Liang hyphenation-tested-with: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.1+tested-with: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.1 description: Configurable Knuth-Liang hyphenation .@@ -29,19 +29,25 @@ . >>> hyphenate icelandic "va\240lahei\240avegavinnuverkf\230rageymslusk\250r" ["va\240la","hei\240a","vega","vinnu","verk","f\230ra","geymslu","sk\250r"]-build-type: Simple+build-type: Custom data-dir: data data-files: *.hyp.txt.gz, *.pat.txt.gz, *.lic.txt.gz, *.chr.txt.gz extra-source-files: .travis.yml CHANGELOG.markdown HLint.hs +custom-setup+ setup-depends:+ base >= 4.3 && <5,+ Cabal >= 1.10,+ cabal-doctest >= 1 && <1.1+ source-repository head type: git location: git://github.com/ekmett/hyphenation.git Flag Embed Description: Embed data in library binary- (Warning: This increases the executable size by about 3Mbs unless+ (Warning: This increases the executable size by about 1Mb unless unneeded language data files are manually removed from the "data" directory before compiling) Default: False@@ -49,7 +55,7 @@ library build-depends: base >= 4 && < 5,- bytestring >= 0.9.4 && < 0.11,+ bytestring >= 0.9 && < 0.11, containers >= 0.3.0.0 && < 0.6, unordered-containers >= 0.2.1 && < 0.3, zlib >= 0.5 && < 0.7@@ -66,6 +72,7 @@ Text.Hyphenation.Pattern other-modules:+ Text.Hyphenation.ByteStringLazyCompat Paths_hyphenation hs-source-dirs: src@@ -78,9 +85,7 @@ build-depends: base, containers,- directory >= 1.0 && < 1.3,- doctest >= 0.8 && < 0.10,- filepath >= 1.3 && < 1.5,+ doctest >= 0.11.2 && < 0.12, hyphenation, unordered-containers ghc-options: -Wall -threaded
@@ -0,0 +1,32 @@+{-# LANGUAGE CPP #-}++-----------------------------------------------------------------------------+-- |+-- Module : Text.Hyphenation.ByteStringLazyCompat+-- Copyright : (C) 2012-2015 Edward Kmett,+-- (C) 2007 Ned Batchelder+-- License : BSD-style (see the languageAffix LICENSE)+--+-- Maintainer : Edward Kmett <ekmett@gmail.com>+-- Stability : provisional+-- Portability : portable+--+----------------------------------------------------------------------------+module Text.Hyphenation.ByteStringLazyCompat+ ( module Lazy+#if !(MIN_VERSION_bytestring(0,10,0))+ , fromStrict+#endif+ ) where++import Data.ByteString.Lazy as Lazy++#if !(MIN_VERSION_bytestring(0,10,0))+import qualified Data.ByteString as BS+import Data.ByteString.Lazy.Internal (ByteString(..))++-- |/O(1)/ Convert a strict 'ByteString' into a lazy 'ByteString'.+fromStrict :: BS.ByteString -> ByteString+fromStrict bs | BS.null bs = Empty+ | otherwise = Chunk bs Empty+#endif
@@ -27,7 +27,7 @@ , coptic, croatian, czech, danish, dutch, english_US, english_GB, esperanto , estonian, ethiopic, {- farsi, -} finnish, french, friulan, galician, georgian, german_1901, german_1996 , german_Swiss, greek_Ancient, greek_Mono, greek_Poly, gujarati, hindi, hungarian- , icelandic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, latin_Classic+ , icelandic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latin_Classic , latvian, lithuanian, malayalam, marathi, mongolian, norwegian_Bokmal , norwegian_Nynorsk, oriya, panjabi, piedmontese, polish, portuguese, romanian, romansh , russian, sanskrit, serbian_Cyrillic, serbocroatian_Cyrillic@@ -41,14 +41,13 @@ #if __GLASGOW_HASKELL__ < 710 import Data.Functor ((<$>)) #endif-import Data.Maybe (fromMaybe) import qualified Data.IntMap as IM+import Text.Hyphenation.ByteStringLazyCompat as Lazy import Text.Hyphenation.Hyphenator import Text.Hyphenation.Pattern import Text.Hyphenation.Exception import System.IO.Unsafe import Data.ByteString.Lazy.Char8 as Char8-import Data.ByteString.Lazy as Lazy #if !EMBED import Paths_hyphenation@@ -75,7 +74,7 @@ pat <- Char8.unpack . decompress <$> (getDataFileName ("hyph-" ++ language ++ ".pat.txt.gz") >>= Lazy.readFile) chr <- Char8.unpack . decompress <$> (getDataFileName ("hyph-" ++ language ++ ".chr.txt.gz") >>= Lazy.readFile) let chrMap = IM.fromList (Prelude.lines chr >>= chrLine)- tryLookup x = fromMaybe x $ IM.lookup (fromEnum x) chrMap+ tryLookup x = IM.findWithDefault x (fromEnum x) chrMap return $ Hyphenator tryLookup (parsePatterns pat) (parseExceptions hyp) defaultLeftMin defaultRightMin #else loadHyphenator language = return $ Hyphenator tryLookup (parsePatterns pat) (parseExceptions hyp) defaultLeftMin defaultRightMin@@ -83,7 +82,7 @@ Just pat = Char8.unpack . decompress . Lazy.fromStrict <$> lookup ("hyph-" ++ language ++ ".pat.txt.gz") hyphenatorFiles Just chr = Char8.unpack . decompress . Lazy.fromStrict <$> lookup ("hyph-" ++ language ++ ".chr.txt.gz") hyphenatorFiles chrMap = IM.fromList (Prelude.lines chr >>= chrLine)- tryLookup x = fromMaybe x $ IM.lookup (fromEnum x) chrMap+ tryLookup x = IM.findWithDefault x (fromEnum x) chrMap #endif -- | A strongly typed set of available languages you can use for hyphenation.@@ -123,7 +122,6 @@ | Italian | Kannada | Kurmanji- | Lao | Latin | Latin_Classic | Latvian@@ -199,7 +197,6 @@ Italian -> "it" Kannada -> "kn" Kurmanji -> "kmr"- Lao -> "lo" Latin -> "la" Latin_Classic -> "la-x-classic" Latvian -> "lv"@@ -264,7 +261,7 @@ coptic, croatian, czech, danish, dutch, esperanto, estonian, ethiopic, {- farsi, -} finnish, friulan, galician, georgian, german_1901, german_1996, german_Swiss, greek_Ancient, greek_Mono, greek_Poly, gujarati, hindi, hungarian,- indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, latin_Classic,+ indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latin_Classic, latvian, lithuanian, malayalam, marathi, mongolian, norwegian_Bokmal, norwegian_Nynorsk, oriya, panjabi, piedmontese, polish, portuguese, romanian, romansh, russian, sanskrit, serbian_Cyrillic, serbocroatian_Cyrillic,@@ -309,7 +306,6 @@ italian = unsafePerformIO (loadHyphenator (languageAffix Italian)) kannada = unsafePerformIO (loadHyphenator (languageAffix Kannada)) kurmanji = unsafePerformIO (loadHyphenator (languageAffix Kurmanji))-lao = unsafePerformIO (loadHyphenator (languageAffix Lao)) latin = unsafePerformIO (loadHyphenator (languageAffix Latin)) latin_Classic = unsafePerformIO (loadHyphenator (languageAffix Latin_Classic)) latvian = unsafePerformIO (loadHyphenator (languageAffix Latvian))@@ -385,7 +381,6 @@ Italian -> italian Kannada -> kannada Kurmanji -> kurmanji- Lao -> lao Latin -> latin Latin_Classic -> latin_Classic Latvian -> latvian
@@ -1,31 +1,25 @@-{-# LANGUAGE CPP #-}+-----------------------------------------------------------------------------+-- |+-- Module : Main (doctests)+-- Copyright : (C) 2012-14 Edward Kmett+-- License : BSD-style (see the file LICENSE)+-- Maintainer : Edward Kmett <ekmett@gmail.com>+-- Stability : provisional+-- Portability : portable+--+-- This module provides doctests for a project based on the actual versions+-- of the packages it was built with. It requires a corresponding Setup.lhs+-- to be added to the project+----------------------------------------------------------------------------- module Main where +import Build_doctests (flags, pkgs, module_sources)+import Data.Foldable (traverse_) import Test.DocTest-import System.Directory-import System.FilePath-#if __GLASGOW_HASKELL__ < 710-import Control.Applicative-#endif-import Control.Monad-import Data.List main :: IO ()-main = getSources >>= \sources -> doctest $- "-isrc"- : "-idist/build/autogen"- : "-optP-include"- : "-optPdist/build/autogen/cabal_macros.h"- : sources--getSources :: IO [FilePath]-getSources = filter (isSuffixOf ".hs") <$> go "src"+main = do+ traverse_ putStrLn args+ doctest args 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+ args = flags ++ pkgs ++ module_sources