<span class="Apple-style-span" style="font-family: &#39;Times New Roman&#39;; font-size: medium; "><pre style="word-wrap: break-word; white-space: pre-wrap; "><font class="Apple-style-span" face="&#39;Times New Roman&#39;"><span class="Apple-style-span" style="white-space: normal;"><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: &#39;Times New Roman&#39;; white-space: normal; "><pre style="word-wrap: break-word; white-space: pre-wrap; ">
<a href="http://hackage.haskell.org/package/properties-0.0.2">http://hackage.haskell.org/package/properties-0.0.2</a></pre><pre style="word-wrap: break-word; white-space: pre-wrap; "><a href="http://hackage.haskell.org/package/properties-0.0.2"></a>Properties can use QuickCheck properties in the same way than assertions are used, for causal debugging of real programs. It also add an human readable structure for grouping properties for classes or libraries. The properties can then be tested in the instance´s body or in programs as if they were assertions. The main advantage is that the compliance of properties can be done with the complete data range that the real application generates (hopefully, with an pleasant separation of real code and debug code).</pre>
<pre style="word-wrap: break-word; white-space: pre-wrap; ">This is a simple example:</pre><pre style="word-wrap: break-word; white-space: pre-wrap; "><br></pre><pre style="word-wrap: break-word; white-space: pre-wrap; ">
<span class="Apple-style-span" style="font-family: sans-serif; white-space: normal; "><pre style="font-size: 13px; ">stringProperty= [<tt style="font-size: 13px; "><a href="http://hackage.haskell.org/packages/archive/properties/0.0.2/doc/html/Test-Properties.html#t%3AProperty" style="color: rgb(0, 0, 224); text-decoration: none; ">Property</a></tt> &quot;length&quot; (\(x, y)-&gt; length (x++y)== length x + length y)]
</pre></span><div style="font-family: sans-serif; white-space: normal; "><br></div></pre><pre style="word-wrap: break-word; white-space: pre-wrap; "><span class="Apple-style-span" style="font-family: sans-serif; white-space: normal; "><pre style="font-size: 13px; ">
main= do
        let s=  &quot;hello &quot;
        let s2= &quot;world&quot;
        print $ s++ s2                 `<tt style="font-size: 13px; "><a href="http://hackage.haskell.org/packages/archive/properties/0.0.2/doc/html/Test-Properties.html#v%3Averify" style="color: rgb(0, 0, 160); text-decoration: none; ">verify</a></tt>` stringProperty `<tt style="font-size: 13px; "><a href="http://hackage.haskell.org/packages/archive/properties/0.0.2/doc/html/Test-Properties.html#v%3Awith" style="color: rgb(0, 0, 160); text-decoration: none; ">with</a></tt>`(s,s2)
        print &quot;that&#39;s all!&quot;</pre><p>It is possible to check quickCheck style properties.</p><p> The same example with a quickCheck-style property:</p><pre style="font-size: 13px; ">quickCheckProperty x y=  length (x++y)== length x + length y

main= do
        let s=  &quot;hello &quot;
        let s2= &quot;world&quot;
        print $ s++ s2           `<tt style="font-size: 13px; "><a href="http://hackage.haskell.org/packages/archive/properties/0.0.2/doc/html/Test-Properties.html#v%3Averify" style="color: rgb(0, 0, 160); text-decoration: none; ">verify</a></tt>` [Property &quot;stringSumLength&quot; $ uncurry quickCheckProperty] `<tt style="font-size: 13px; "><a href="http://hackage.haskell.org/packages/archive/properties/0.0.2/doc/html/Test-Properties.html#v%3Awith" style="color: rgb(0, 0, 160); text-decoration: none; ">with</a></tt>`(s,s2)
        print &quot;that&#39;s all!&quot;</pre><pre style="font-size: 13px; "><br></pre><pre style="font-size: 13px; ">The package include a more sophisticated example. </pre><pre style="font-size: 13px; ">I Hope that this would be useful </pre>
<pre style="font-size: 13px; "><br></pre><pre style="font-size: 13px; ">Alberto</pre></span></pre></span></span></font></span></font></pre></span>