sml - 这里的“isSome old(tl dates)”是什么意思;为什么“最旧(tl 日期)”有一个选项类型?
问题描述
fun oldest (dates: (int*int*int) list) =
if null dates
then NONE
else let
val ans = oldest(tl dates)
in
if isSome ans andalso is_older(valOf ans, hd dates)
then ans
else SOME (hd dates)
end
一个函数比较列表中的所有日期(如 2018、2、28),并获取最旧的日期
解决方案
推荐阅读
- php - 如何在 AWS SNS 上设置发件人号码(使用 PHP v3 SDK)
- docker - 为什么 docker 占用大量空间以及如何处理它?
- java - 如何告诉 UI 线程为另一个线程的按钮设置动画?
- reactjs - 赛普拉斯不输入日期
- node.js - 使用属性过滤查询中的对象 mongodb 列表
- image - Image.Network 周围奇怪的神秘边界
- java - 如何将 dockerfile maven 插件迁移到 gradle
- c# - 调用 asp.net 核心操作时出现 json 错误
- node.js - Mongoose,NODE JS 返回 undefined 但在 findOne 中收集了正确的数据
- java - 我可以在公共 IP 上运行 AWS Lightsail 上的简单 Spring Boot 应用程序吗?