diff options
author | Mark Wright <gienah@gentoo.org> | 2013-04-02 07:27:00 +0000 |
---|---|---|
committer | Mark Wright <gienah@gentoo.org> | 2013-04-02 07:27:00 +0000 |
commit | 7ca87c16760ed9e2d32a7f6c89d929baf4c98e8a (patch) | |
tree | e9330f8af55ff0c1bb74a2dd20c43b393f6bdc9b /dev-haskell/chasingbottoms | |
parent | Add chasingbottoms (diff) | |
download | historical-7ca87c16760ed9e2d32a7f6c89d929baf4c98e8a.tar.gz historical-7ca87c16760ed9e2d32a7f6c89d929baf4c98e8a.tar.bz2 historical-7ca87c16760ed9e2d32a7f6c89d929baf4c98e8a.zip |
Add chasingbottoms
Package-Manager: portage-2.2.0_alpha171/cvs/Linux x86_64
Manifest-Sign-Key: 0x618E971F
Diffstat (limited to 'dev-haskell/chasingbottoms')
-rw-r--r-- | dev-haskell/chasingbottoms/Manifest | 13 | ||||
-rw-r--r-- | dev-haskell/chasingbottoms/chasingbottoms-1.3.0.5-r2.ebuild | 46 | ||||
-rw-r--r-- | dev-haskell/chasingbottoms/metadata.xml | 102 |
3 files changed, 160 insertions, 1 deletions
diff --git a/dev-haskell/chasingbottoms/Manifest b/dev-haskell/chasingbottoms/Manifest index f7951b22c15a..23198d703920 100644 --- a/dev-haskell/chasingbottoms/Manifest +++ b/dev-haskell/chasingbottoms/Manifest @@ -1,3 +1,14 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + DIST ChasingBottoms-1.3.0.5.tar.gz 31053 SHA256 c0f770e7b06c8ffcc3d6ceedd2db96f6fee3c0ffeab5de2deda0de8798286c3c SHA512 e1a69ded02716f53b4985511ec09bca42eac25be5e0ee03255f50f89a806c2beeac74872014498be3f72e547486ef454210832e8788907c740ae27c3f9f1be70 WHIRLPOOL af6d8fdaf8dfa98eeb38df3a0bd583c1180a96ec02a6e08581b5917ad25d3ad40a4bbf562755f40e2902fa95c7c721a1117f5b731830d0b68fc4dbe3cdca54ac -EBUILD chasingbottoms-1.3.0.5-r2.ebuild 1230 SHA256 9585a01c830f08f1035c97cf49e9d17e7fbbf9a5034a176e7c654529db813434 SHA512 86344a4792f5dff11090e135c1b8fc5610650f53942c7130bb98b4ceebf25cee04cb7c1cc93843724cfd97a74c6a87c4e3606a0d695c21278d26c44126571f0a WHIRLPOOL e32186d4ed95a7ab3b7cdadb7a8674d4186747e2f9b38a394d58ae22660426727f455eaf7354d20a7f170fafa9463545f26e93b93333d2bd9ba0e3673cf99823 +EBUILD chasingbottoms-1.3.0.5-r2.ebuild 1351 SHA256 bcc846b52da31b414d983ca9c4f0296832d8cc701bc32fad986be264521ae520 SHA512 a17631512e2f627c6f63cc344fb24f7a413fd2b1e7c9d9cb40ce2d29f5540d0f1f548914b0e82749d870bed478514f65bed92126747955a89b6948bf7be394bb WHIRLPOOL 060643c2558787bc8d4abe7885f0d51006d1c91e3f62468deea32f3305dbeb30980858f736b3995aa530f3e774e6db7f02ad8e15ea089b3297b5af0ff1532ad8 +MISC ChangeLog 387 SHA256 8bbeded057efb93778e3bdfe8aeb1910cc5710f5337071012328b605ea4b8188 SHA512 d8c8f5c33987d46aef1a6e7aef73fbe445ff60503fddc3a3b0b5f99a1a0c0f72978828930623350ae7d28022f21c30038f8e463ea27d1f4008dca016a24c504e WHIRLPOOL da8eb2a89bc63a4b1399ac8aa10efa333c461b3264ac0743f479e82b3d37db3bba99a9164a94b6231eaed3ad7eb31388aa247cb05869a0583fb4bea631e93bc4 MISC metadata.xml 4168 SHA256 5f4e41545c431ae69197b68a4a81d5214c47412b082610c9c56dfe4d0773398b SHA512 3d48c425c23cac326560fe3d921c1fd9b85a756e7ce3adb75eda270713fd48c4797482132049ef182cd796a8d98ec90c8252bd719f3a4d31d16eee6d5217eca3 WHIRLPOOL 71b9f591d24a75f87971360401788aa45f094509413316a3005f990e8ef5db436e4e7c60e62c0c7989ffeff255dffebe3b668fbaec9189cea77922a7df4e7209 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.19 (GNU/Linux) + +iF4EAREIAAYFAlFaiBoACgkQoBEVQmGOlx8o1QEA4vbrJ85OyklDDBZPCIDl4JQ8 +eHMCUArP00XYGjeCheAA/Aj1VGG69vsKV/I4BJstaRIadXnLarWEQSqKHVpoNOqG +=/nfu +-----END PGP SIGNATURE----- diff --git a/dev-haskell/chasingbottoms/chasingbottoms-1.3.0.5-r2.ebuild b/dev-haskell/chasingbottoms/chasingbottoms-1.3.0.5-r2.ebuild new file mode 100644 index 000000000000..98c45ff72794 --- /dev/null +++ b/dev-haskell/chasingbottoms/chasingbottoms-1.3.0.5-r2.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-haskell/chasingbottoms/chasingbottoms-1.3.0.5-r2.ebuild,v 1.1 2013/04/02 07:26:52 gienah Exp $ + +EAPI=5 + +# ebuild generated by hackport 0.3.1.9999 + +CABAL_FEATURES="bin lib profile haddock hoogle hscolour" +inherit base haskell-cabal + +MY_PN="ChasingBottoms" +MY_P="${MY_PN}-${PV}" + +DESCRIPTION="For testing partial and infinite values." +HOMEPAGE="http://hackage.haskell.org/package/ChasingBottoms" +SRC_URI="mirror://hackage/packages/archive/${MY_PN}/${PV}/${MY_P}.tar.gz" + +LICENSE="MIT" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~x86" +IUSE="" + +RDEPEND=">=dev-haskell/mtl-1.1:=[profile?] + <dev-haskell/mtl-2.2:=[profile?] + >=dev-haskell/quickcheck-2.1:2=[profile?] + <dev-haskell/quickcheck-2.7:2=[profile?] + =dev-haskell/random-1.0*:=[profile?] + >=dev-haskell/syb-0.1.0.2:=[profile?] + <dev-haskell/syb-0.5:=[profile?] + >=dev-lang/ghc-6.12.1:=" +DEPEND="${RDEPEND} + >=dev-haskell/cabal-1.8" + +S="${WORKDIR}/${MY_P}" + +PATCHES=("${FILESDIR}/${PN}-1.3.0.5-ghc-7.6.patch") + +src_prepare() { + base_src_prepare + + CABAL_FILE=${MY_PN}.cabal cabal_chdeps \ + 'base >= 4.0 && < 4.7' 'base >= 4.0 && < 5.0' \ + 'syb >= 0.1.0.2 && < 0.4' 'syb >= 0.1.0.2 && < 0.5' \ + 'QuickCheck >= 2.1 && < 2.6' 'QuickCheck >= 2.1 && < 2.7' +} diff --git a/dev-haskell/chasingbottoms/metadata.xml b/dev-haskell/chasingbottoms/metadata.xml new file mode 100644 index 000000000000..e3067a08a43d --- /dev/null +++ b/dev-haskell/chasingbottoms/metadata.xml @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>haskell</herd> + <maintainer> + <email>haskell@gentoo.org</email> + </maintainer> + <longdescription> + Do you ever feel the need to test code involving bottoms (e.g. calls to + the @error@ function), or code involving infinite values? Then this + library could be useful for you. + + It is usually easy to get a grip on bottoms by showing a value and + waiting to see how much gets printed before the first exception is + encountered. However, that quickly gets tiresome and is hard to automate + using e.g. QuickCheck + (<http://www.cse.chalmers.se/~rjmh/QuickCheck/>). With this library you + can do the tests as simply as the following examples show. + + Testing explicitly for bottoms: + + [@> isBottom (head [\])@] @True@ + + [@> isBottom bottom@] @True@ + + [@> isBottom (\\_ -> bottom)@] @False@ + + [@> isBottom (bottom, bottom)@] @False@ + + Comparing finite, partial values: + + [@> ((bottom, 3) :: (Bool, Int)) ==! (bottom, 2+5-4)@] @True@ + + [@> ((bottom, bottom) :: (Bool, Int)) <! (bottom, 8)@] @True@ + + Showing partial and infinite values (@\\\/!@ is join and @\/\\!@ is meet): + + [@> approxShow 4 $ (True, bottom) \\\/! (bottom, \'b\')@] @\"Just (True, \'b\')\"@ + + [@> approxShow 4 $ (True, bottom) \/\\! (bottom, \'b\')@] @\"(_|_, _|_)\"@ + + [@> approxShow 4 $ ([1..\] :: [Int\])@] @\"[1, 2, 3, _\"@ + + [@> approxShow 4 $ (cycle [bottom\] :: [Bool\])@] @\"[_|_, _|_, _|_, _\"@ + + Approximately comparing infinite, partial values: + + [@> approx 100 [2,4..\] ==! approx 100 (filter even [1..\] :: [Int\])@] @True@ + + [@> approx 100 [2,4..\] \/=! approx 100 (filter even [bottom..\] :: [Int\])@] @True@ + + The code above relies on the fact that @bottom@, just as @error + \"...\"@, @undefined@ and pattern match failures, yield + exceptions. Sometimes we are dealing with properly non-terminating + computations, such as the following example, and then it can be nice to + be able to apply a time-out: + + [@> timeOut' 1 (reverse [1..5\])@] @Value [5,4,3,2,1]@ + + [@> timeOut' 1 (reverse [1..\])@] @NonTermination@ + + The time-out functionality can be used to treat \"slow\" computations as + bottoms: + + [@> let tweak = Tweak &#x7b; approxDepth = Just 5, timeOutLimit = Just 2 &#x7d;@] + + [@> semanticEq tweak (reverse [1..\], [1..\]) (bottom :: [Int\], [1..\] :: [Int\])@] @True@ + + [@> let tweak = noTweak &#x7b; timeOutLimit = Just 2 &#x7d;@] + + [@> semanticJoin tweak (reverse [1..\], True) ([\] :: [Int\], bottom)@] @Just ([],True)@ + + This can of course be dangerous: + + [@> let tweak = noTweak &#x7b; timeOutLimit = Just 0 &#x7d;@] + + [@> semanticEq tweak (reverse [1..100000000\]) (bottom :: [Integer\])@] @True@ + + Timeouts can also be applied to @IO@ computations: + + [@> let primes = unfoldr (\\(x:xs) -> Just (x, filter ((\/= 0) . (\`mod\` x)) xs)) [2..\]@] + + [@> timeOutMicro 100 (print $ filter ((== 1) . (\`mod\` 83)) primes)@] @[167,499,9NonTermination@ + + [@> timeOutMicro 100 (print $ take 6 $ filter ((== 1) . (\`mod\` 83)) primes)@] @[167,499,997,1163,1993NonTermination@ + + [@> timeOutMicro 100 (print $ take 6 $ filter ((== 1) . (\`mod\` 83)) primes)@] @[167,499,997,1163,1993,2657]@ + + [@ @] @Value ()@ + + For the underlying theory and a larger example involving use of + QuickCheck, see the article \"Chasing Bottoms, A Case Study in Program + Verification in the Presence of Partial and Infinite Values\" + (<http://www.cse.chalmers.se/~nad/publications/danielsson-jansson-mpc2004.html>). + + The code has been tested using GHC. Most parts can probably be + ported to other Haskell compilers, but this would require some work. + The @TimeOut@ functions require preemptive scheduling, and most of + the rest requires @Data.Generics@; @isBottom@ only requires + exceptions, though. + </longdescription> +</pkgmetadata> |