<div dir="ltr"><div>The `time` package equivalent of `MyDate` would be `Day`:</div><div><br></div><div><font face="monospace">storeDate :: Day</font></div><div><font face="monospace">storeDate = fromGregorian 2021 6 29</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">> storeDate</font></div><div><span style="font-family:monospace">2021-06-29</span></div><div><span style="font-family:monospace">> toGregorian storeDate</span></div><div><span style="font-family:monospace">(2021,6,29)</span></div><div><span style="font-family:monospace">> dayOfWeek storeDate<br></span></div><div><span style="font-family:monospace">Tuesday</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace"><font face="arial,sans-serif">However, I don't see any easy conversion between the numeric month and its English name.</font><br></span></div><div><font face="monospace"></font></div><div><font face="monospace"></font><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 29, 2021 at 10:58 PM Galaxy Being <<a href="mailto:borgauf@gmail.com" target="_blank">borgauf@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I've looked at Data.Time, but I'm not seeing examples. I'd like to figure out how to simply have use of similar to this:<div><br></div><div><font face="monospace">type MyMonth = String</font></div><div><font face="monospace">type MyDay = String</font></div><div><font face="monospace">type MyYear = String</font></div><div><font face="monospace">data MyDate = MyDate MyMonth MyDay MyYear deriving Show</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">storeDate :: MyDate</font></div><div><font face="monospace">storeDate = "June" "29" "2021"</font><br clear="all"><div><br></div><div>which will be in a bigger data structure I'm building. I can't believe this isn't reinventing some long-established wheel. Is there such a type ready to use?</div><div><br></div><div dir="ltr"><div dir="ltr"><div>⨽<br></div>Lawrence Bottorff<div>Grand Marais, MN, USA</div><div><a href="mailto:borgauf@gmail.com" target="_blank">borgauf@gmail.com</a></div></div></div></div></div>
_______________________________________________<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>