backup de julho
[h2N7SspZmY.git] / data / cache / 8 / 8e41de0ddecf4e1f61524e3e6f6869c7.code
blobeeef923d7cf805e2bf1920aab910342ec075ad7e
1 <span class="kw1">module</span> Shapes   
2 <span class="br0">&#40;</span> Shape<span class="br0">&#40;</span><span class="sy0">..</span><span class="br0">&#41;</span>  
3 <span class="sy0">,</span> surface
4 <span class="br0">&#41;</span> <span class="kw1">where</span>
5 &nbsp;
6 <span class="kw1">data</span> Shape <span class="sy0">=</span> Circle <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <span class="sy0">|</span> Rectangle <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a>
7 <span class="kw1">data</span> Shape <span class="sy0">=</span> Circle <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <span class="sy0">|</span> Rectangle <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a> <span class="kw1">deriving</span> <span class="br0">&#40;</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Show"><span class="kw4">Show</span></a><span class="br0">&#41;</span>
8 &nbsp;
9 surface <span class="sy0">::</span> Shape <span class="sy0">-&gt;</span> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Float"><span class="kw4">Float</span></a>  
10 surface <span class="br0">&#40;</span>Circle <span class="sy0">_</span> <span class="sy0">_</span> r<span class="br0">&#41;</span> <span class="sy0">=</span> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:pi"><span class="kw3">pi</span></a> <span class="sy0">*</span> r <span class="sy0">^</span> 2  
11 surface <span class="br0">&#40;</span>Rectangle x1 y1 x2 y2<span class="br0">&#41;</span> <span class="sy0">=</span> <span class="br0">&#40;</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:abs"><span class="kw3">abs</span></a> <span class="sy0">$</span> x2 <span class="sy0">-</span> x1<span class="br0">&#41;</span> <span class="sy0">*</span> <span class="br0">&#40;</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:abs"><span class="kw3">abs</span></a> <span class="sy0">$</span> y2 <span class="sy0">-</span> y1<span class="br0">&#41;</span>