<div dir="ltr">Hey all!<br><br>I'm trying to understand what's going on in GHC.Generics and defining a generic class... I understand that there's a `Selector` class and `selName` function that can get the <i>name</i> of a selector, but is there a way to access the selector function itself? The documentation conveniently avoids examples involving records and is otherwise quite barren.<br><br>So if I have a data type like...<br><br><div style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: break-word;" class="prettyprint"><code class="prettyprint"><div class="subprettyprint"><span style="color: #000;" class="styled-by-prettify">data </span><span style="color: #606;" class="styled-by-prettify">Person</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #606;" class="styled-by-prettify">Person</span><span style="color: #000;" class="styled-by-prettify"><br>  Â  </span><span style="color: #660;" class="styled-by-prettify">{</span><span style="color: #000;" class="styled-by-prettify"> name </span><span style="color: #660;" class="styled-by-prettify">::</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #606;" class="styled-by-prettify">String</span><span style="color: #000;" class="styled-by-prettify"><br>  Â  </span><span style="color: #660;" class="styled-by-prettify">,</span><span style="color: #000;" class="styled-by-prettify"> age </span><span style="color: #660;" class="styled-by-prettify">::</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #606;" class="styled-by-prettify">Int</span><span style="color: #000;" class="styled-by-prettify"><br>  Â  </span><span style="color: #660;" class="styled-by-prettify">}</span><span style="color: #000;" class="styled-by-prettify"> deriving </span><span style="color: #606;" class="styled-by-prettify">Generic</span><span style="color: #000;" class="styled-by-prettify"><br><br>instance </span><span style="color: #606;" class="styled-by-prettify">MyTypeClass</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #606;" class="styled-by-prettify">Person</span><span style="color: #000;" class="styled-by-prettify"><br></span></div></code></div><br>I want my generic implementation of <span style="font-family: courier new,monospace;">MyTypeClass</span> to be able to access each selector function in the record, <span style="font-family: courier new,monospace;">f :: Person -> String</span>, <span style="font-family: courier new,monospace;">g :: Person -> Int</span>, etc.<br><br>Chris<br></div>