Re: [Haskell-cafe] Quick-check: how to generate arbitrary complex data?

2013-07-13 Thread martin
Am 07/12/2013 09:18 AM, schrieb Roman Cheplyaka: QuickCheck's Gen is a functor. So you can generate a list, and then use fmap to add a hash to it. instance Arbitrary HashedList where arbitrary = addHashToList $ arbitrary This requires HashedList to be a new type, right? So far my

Re: [Haskell-cafe] Quick-check: how to generate arbitrary complex data?

2013-07-13 Thread Aleksey Uymanov
On Sat, 13 Jul 2013 10:10:39 +0200 martin martin.drautzb...@web.de wrote: This requires HashedList to be a new type, right? So far my code only used type synonyms. Does this mean I have to convert type synonyms into types in order to use QuickCheck? Does this mean I have to plan for

Re: [Haskell-cafe] Quick-check: how to generate arbitrary complex data?

2013-07-13 Thread Roman Cheplyaka
* martin martin.drautzb...@web.de [2013-07-13 10:10:39+0200] Am 07/12/2013 09:18 AM, schrieb Roman Cheplyaka: QuickCheck's Gen is a functor. So you can generate a list, and then use fmap to add a hash to it. instance Arbitrary HashedList where arbitrary = addHashToList $

[Haskell-cafe] Quick-check: how to generate arbitrary complex data?

2013-07-12 Thread martin
Hello all, I have a type (Mail) which consists of hash and a list, where the hash keeps some redundant data of the list for faster access. I can add and remove elements to values of this type using custom functions, called push and pop. Now I wanted to write some quick checks, but I have no clue

Re: [Haskell-cafe] Quick-check: how to generate arbitrary complex data?

2013-07-12 Thread Roman Cheplyaka
* martin martin.drautzb...@web.de [2013-07-12 08:33:54+0200] Hello all, I have a type (Mail) which consists of hash and a list, where the hash keeps some redundant data of the list for faster access. I can add and remove elements to values of this type using custom functions, called push

[Haskell-cafe] Quick check finite data generation

2011-09-22 Thread mukesh tiwari
Hello all I have a data type data Index = Index {indexSize::Float, indexIds::[Int], indexDown::(IntMap.IntMap Index)} | IndexLeaf {indexSize::Float, indexIds::[Int]} | IndexEmpty {indexSize::Float} deriving ( Show , Eq ) I derived some thing like this for QuickCheck testing instance

Re: [Haskell-cafe] Quick check finite data generation

2011-09-22 Thread ezra
Mukesh, You need to write a generator function for the type (IntMap Index) which keeps track of the n parameter that you're using in arbIndex. You can't rely on the Arbitrary instance for (IntMap a) because it doesn't have access to the n parameter that you are so controlling in arbIndex.

[Haskell-cafe] Quick check?

2008-04-08 Thread Galchin, Vasili
Hello, What are some examples of libraries in HackageDB that use either Quick Check (pure side) or Monad testing? Is there a way to use darcs to answer my question? Thanks, vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Quick check?

2008-04-08 Thread Ketil Malde
Galchin, Vasili [EMAIL PROTECTED] writes: What are some examples of libraries in HackageDB that use either Quick Check (pure side) or Monad testing? Is there a way to use darcs to answer my question? I used the ByteString library as a guideline when developing testing (and to a lesser