有Haskell资料库吗?

编程入门 行业动态 更新时间:2024-10-19 08:57:21
本文介绍了有Haskell资料库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Haskell中是否有一个函数,可以让我输入可以从中获取信息的日期部分(例如字符串表示形式或星期,月份,年份,年份等),例如星期几,一个月中的某天等等。 ?

Is there a function in Haskell that will allow me to enter component of a date (like a string representation or day month year components) that I can get information from (like day of week, days in a month, etc.)?

我在网上看过,似乎有很多自定义库,但是我希望ghci 10.6.4的标准前奏库中有一个

I've looked online and it looks like there are a lot of custom libraries, but I'm hoping there's one in the standard prelude library of ghci 10.6.4 that's just not well documented?

推荐答案

是 Data.Time.Calendar 和 Data.Time.Format 在时间库是否足够?

您可以使用 gregorianMonthLength 解析日期的字符串表示形式并获得一个月的长度。尽管可以使用仅显示星期几的格式将日期格式化为字符串,但不能确定星期几。

You can parse a string representation of a date and get the length of a month using gregorianMonthLength. Not sure about day of the week, though you could format the date as a string using a format that just displays the week day.

更多推荐

有Haskell资料库吗?

本文发布于:2023-10-24 14:09:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524144.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:资料库   Haskell

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!