Get rid of some CPP by upgrading to generic-random-1.3 (#1292)

This commit is contained in:
Simon Jakobi 2019-09-08 20:42:22 +02:00 committed by mergify[bot]
parent bfa6819282
commit d1d0b3d462
5 changed files with 5 additions and 18 deletions

View File

@ -598,7 +598,7 @@ Test-Suite tasty
directory ,
filepath ,
foldl < 1.5 ,
generic-random >= 1.2.0.0 && < 1.3 ,
generic-random >= 1.3.0.0 && < 1.4 ,
lens-family-core >= 1.0.0 && < 2.1 ,
megaparsec ,
prettyprinter ,

View File

@ -1,14 +1,9 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
#if __GLASGOW_HASKELL__ >= 800
{-# LANGUAGE OverloadedLabels #-}
#endif
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Dhall.Test.QuickCheck where
@ -194,10 +189,6 @@ instance (Arbitrary s, Arbitrary a) => Arbitrary (Expr s a) where
-- They will fail to compile if the constructors don't appear in the order
-- in which they are defined in 'Expr'!
weights :: Weights (Expr s a)
-- TODO: Get rid of the CPP once
-- https://github.com/Lysxia/generic-random/pull/16
-- has been released.
#if __GLASGOW_HASKELL__ >= 800
weights =
(7 :: W "Const")
% (7 :: W "Var")
@ -267,9 +258,6 @@ instance (Arbitrary s, Arbitrary a) => Arbitrary (Expr s a) where
% (7 :: W "ImportAlt")
% (7 :: W "Embed")
% ()
#else
weights = Generic.Random.uniform
#endif
shrink expression = filter standardizedExpression (genericShrink expression)

View File

@ -1,10 +1,8 @@
{ mkDerivation, base, deepseq, QuickCheck, stdenv }:
mkDerivation {
pname = "generic-random";
version = "1.2.0.0";
sha256 = "9b1e00d2f06b582695a34cfdb2d8b62b32f64152c6ed43f5c2d776e6e9aa148c";
revision = "1";
editedCabalFile = "1d0hx41r7yq2a86ydnfh2fv540ah8cz05l071s2z4wxcjw0ymyn4";
version = "1.3.0.0";
sha256 = "f3c3025f5d9a44252a26d67446e2077331c005217233a1b52abec90fd6a6c2fc";
libraryHaskellDepends = [ base QuickCheck ];
testHaskellDepends = [ base deepseq QuickCheck ];
homepage = "http://github.com/lysxia/generic-random";

View File

@ -30,7 +30,7 @@ extra-deps:
- foldl-1.4.5
- formatting-6.3.2
- foundation-0.0.19
- generic-random-1.2.0.0
- generic-random-1.3.0.0
- hashable-1.2.7.0
- haskeline-0.7.4.2
- integer-logarithms-1.0.3

View File

@ -16,6 +16,7 @@ extra-deps:
- hnix-store-core-0.1.0.0@sha256:719a261870367b3ce2e2e8d11502e7170faa664109a14486b95b555bc3672807,2541
- monadlist-0.0.2@sha256:978305e3f03dd5f65c673b551124dac0c39a247c2c14d84739ca9a3405fbb63a,904
- ref-tf-0.4.0.1@sha256:369e5c6237e4b6fe330fde021b94a9f98971690cbec5b910faa9af3cbcb15610,1133
- generic-random-1.3.0.0
nix:
packages:
- ncurses