<p dir="ltr">I feel the latter example serves only documentation purposes. Maybe describe what those floats are in the former example and you can ignore the extra type aliases entirely.</p>
<p dir="ltr">Introducing a new concern for your module/application when it appears only once might just add extra complexity.</p>
<p dir="ltr">Of course, as the codebase grows and this datatype evolves, you'll probably want to go that route, but until then, I think it's preemptively unecessery.</p>
<p dir="ltr">- nitrix</p>
<div class="gmail_quote">On Nov 7, 2015 4:56 PM, "Roelof Wobben" <<a href="mailto:r.wobben@home.nl">r.wobben@home.nl</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
In the book there is a example of this data-structure.<br>
<br>
data Shape = Circle float float<br>
| Rectangle float float<br>
<br>
Now I have to change it to add a center point.<br>
<br>
But I wonder if this is not a better way to describe it<br>
<br>
Data Schape = Circle Radius<br>
| Rectangle Width Height<br>
<br>
Type Radius = Float<br>
type Width = Float<br>
type Height = Float<br>
<br>
Roelof<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div>