<div dir="ltr"><div dir="ltr"><div>Dear list,</div><div><br></div><div>Is it possible te get the number of fields for data constructors for a plain ADT, i.e something with no record fields? E.g for</div><div><br></div><div>data T = A Int Double | B String (Maybe String)</div><div><br></div><div>it would give 2 for both `A` and `B`.</div><div><br></div><div>For a record it's possible using the <a id="gmail-v:constrFields" class="gmail-def">`constrFields` function from Data.Data.</a></div><div><a id="gmail-v:constrFields" class="gmail-def"><br></a></div><div><a id="gmail-v:constrFields" class="gmail-def">I was trying to follow this tutorial by Christopher Done https://chrisdone.com/posts/data-typeable, and I feel that it must be possible somehow to get these numbers with the gmap*/gfold* functions, but the use of them is over my head at the moment.</a></div><div><a id="gmail-v:constrFields" class="gmail-def"><br></a></div><div><a id="gmail-v:constrFields" class="gmail-def"><br></a></div><div><a id="gmail-v:constrFields" class="gmail-def">Best,<br></a></div><div><br></div><div><br></div><div><br>-- <br><div dir="ltr" class="gmail_signature">Markus Läll<br></div></div></div></div>