Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > d4d89afd994d97d86f808e6225684a4f > files > 56

ghc-uniplate-devel-1.6-5.fc15.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Data.Generics.PlateTypeable</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Data-Generics-PlateTypeable.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Generics-PlateTypeable.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">uniplate-1.6: Help writing simple, concise and fast generic operations.</p></div><div id="content"><div id="module-header"><p class="caption">Data.Generics.PlateTypeable</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">The Class
</a></li><li><a href="#g:2">The Combinators
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p><em>RECOMMENDATION</em>: Use <a href="Data-Generics-Uniplate-Typeable.html">Data.Generics.Uniplate.Typeable</a> instead.
</p><p>This module supplies a method for writing <code><a href="Data-Generics-Biplate.html#t:Biplate">Biplate</a></code> instances more easily.
</p><p>To take an example:
</p><pre> data Expr = Var Int | Neg Expr | Add Expr Expr

 instance Typeable Expr where ...

 instance (Typeable a, Uniplate a) =&gt; PlateAll Expr a where
   plateAll (Var x  ) = plate Var |- x
   plateAll (Neg x  ) = plate Neg |+ x
   plateAll (Add x y) = plate Add |+ x |+ y

 instance Uniplate Expr where
   uniplate = uniplateAll
</pre></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short">module <a href="Data-Generics-Biplate.html">Data.Generics.Biplate</a></li><li class="src short">module <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html">Data.Typeable</a></li><li class="src short"><span class="keyword">class</span>  <a href="#t:PlateAll">PlateAll</a> from to  <span class="keyword">where</span><ul class="subs"><li><a href="#v:plateAll">plateAll</a> :: from -&gt; Type from to</li></ul></li><li class="src short"><a href="#v:uniplateAll">uniplateAll</a> :: <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> a b =&gt; a -&gt; (<a href="Data-Generics-Str.html#t:Str">Str</a> b, <a href="Data-Generics-Str.html#t:Str">Str</a> b -&gt; a)</li><li class="src short"><a href="#v:plate">plate</a> ::  from -&gt; Type from to</li><li class="src short"><a href="#v:-124--43-">(|+)</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> item, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> to, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> item to) =&gt; Type (item -&gt; from) to -&gt; item -&gt; Type from to</li><li class="src short"><a href="#v:-124--45-">(|-)</a> ::  Type (item -&gt; from) to -&gt; item -&gt; Type from to</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src">module <a href="Data-Generics-Biplate.html">Data.Generics.Biplate</a></p></div><div class="top"><p class="src">module <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html">Data.Typeable</a></p></div><h1 id="g:1">The Class
</h1><div class="top"><p class="src"><span class="keyword">class</span>  <a name="t:PlateAll" class="def">PlateAll</a> from to  <span class="keyword">where</span><a href="src/Data-Generics-PlateTypeable.html#PlateAll" class="link">Source</a></p><div class="doc"><p>This class represents going from the container type to the target.
</p><p>This class should only be constructed with <code><a href="Data-Generics-PlateTypeable.html#v:plate">plate</a></code>, <code><a href="Data-Generics-PlateTypeable.html#v:-124--43-">|+</a></code> and <code><a href="Data-Generics-PlateTypeable.html#v:-124--45-">|-</a></code>
</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:plateAll" class="def">plateAll</a> :: from -&gt; Type from to<a href="src/Data-Generics-PlateTypeable.html#plateAll" class="link">Source</a></p></div><div class="subs instances"><p id="control.i:PlateAll" class="caption collapser" onclick="toggleSection('i:PlateAll')">Instances</p><div id="section.i:PlateAll" class="show"><table><tr><td class="src"><a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a> to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:Char">Char</a> to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Double">Double</a> to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Float">Float</a> to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Integer">Integer</a> to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> () to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> from to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> from, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> to, <a href="Data-Generics-UniplateStr.html#t:Uniplate">Uniplate</a> to) =&gt; <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> [from] to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> from to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> from, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> to, <a href="Data-Generics-UniplateStr.html#t:Uniplate">Uniplate</a> to) =&gt; <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> from) to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> a to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> a, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> b to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> b, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> to, <a href="Data-Generics-UniplateStr.html#t:Uniplate">Uniplate</a> to) =&gt; <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Either.html#t:Either">Either</a> a b) to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> a to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> a, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> b to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> b, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> to, <a href="Data-Generics-UniplateStr.html#t:Uniplate">Uniplate</a> to) =&gt; <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> (a, b) to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> a to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> a, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> b to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> b, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> c to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> c, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> to, <a href="Data-Generics-UniplateStr.html#t:Uniplate">Uniplate</a> to) =&gt; <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> (a, b, c) to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> a to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> a, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> b to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> b, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> c to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> c, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> d to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> d, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> to, <a href="Data-Generics-UniplateStr.html#t:Uniplate">Uniplate</a> to) =&gt; <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> (a, b, c, d) to</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> a to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> a, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> b to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> b, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> c to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> c, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> d to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> d, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> e to, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> e, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> to, <a href="Data-Generics-UniplateStr.html#t:Uniplate">Uniplate</a> to) =&gt; <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> (a, b, c, d, e) to</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:uniplateAll" class="def">uniplateAll</a> :: <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> a b =&gt; a -&gt; (<a href="Data-Generics-Str.html#t:Str">Str</a> b, <a href="Data-Generics-Str.html#t:Str">Str</a> b -&gt; a)<a href="src/Data-Generics-PlateTypeable.html#uniplateAll" class="link">Source</a></p><div class="doc"><p>This function is used to write a <code><a href="Data-Generics-UniplateStr.html#t:Uniplate">Uniplate</a></code> instance from a <code><a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a></code> one
</p></div></div><h1 id="g:2">The Combinators
</h1><div class="top"><p class="src"><a name="v:plate" class="def">plate</a> ::  from -&gt; Type from to<a href="src/Data-Generics-PlateTypeable.html#plate" class="link">Source</a></p><div class="doc"><p>The main combinator used to start the chain.
</p><p>The following rule can be used for optimisation:
</p><pre> plate Ctor |- x == plate (Ctor x)
</pre></div></div><div class="top"><p class="src"><a name="v:-124--43-" class="def">(|+)</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> item, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable">Typeable</a> to, <a href="Data-Generics-PlateTypeable.html#t:PlateAll">PlateAll</a> item to) =&gt; Type (item -&gt; from) to -&gt; item -&gt; Type from to<a href="src/Data-Generics-PlateTypeable.html#%7C%2B" class="link">Source</a></p><div class="doc"><p>the field to the right may contain the target.
</p></div></div><div class="top"><p class="src"><a name="v:-124--45-" class="def">(|-)</a> ::  Type (item -&gt; from) to -&gt; item -&gt; Type from to<a href="src/Data-Generics-PlateTypeable.html#%7C-" class="link">Source</a></p><div class="doc"><p>The field to the right <em>does not</em> contain the target.
 This can be used as either an optimisation, or more commonly for excluding
 primitives such as Int.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>