我如何找出当前语言环境中一周的第一天?

how do I find out which is the first day of the week in the current locale?

如何获取 haskell 中当前语言环境的一周的第一天(星期日或星期一)?

old-locale 以字符串形式给出了星期几。我在 time 库中也没有找到任何内容。

我希望它是一个已经包含在 base 中的函数,这样我就不需要安装新的外部库了。

我想您必须自己编写该函数。来自 this answer:

From CLDR's supplemental data:

<firstDay day="mon" territories="001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK" />
<firstDay day="fri" territories="BD MV" />
<firstDay day="sat" territories="AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY" />
<firstDay day="sun" territories="AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW" />
<firstDay day="sun" territories="GB" alt="variant" references="Shorter Oxford Dictionary (5th edition, 2002)" />

(Territory 001 is "World")