blob: cb66a8eebd13fa6b136a28ad8c0559430876657b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="author" content="含暮秋">
<meta name="subtitle" content="暮秋小屋">
<meta name="description" content="不卑不亢的码农, 朴素的民谣诗人">
<meta name="keywords" content="韩暮秋,MuqiuHan">
<title>OCaml News Intro | 暮秋小屋</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&family=Roboto+Mono&display=swap');
</style>
<!-- stylesheets list from _config.yml -->
<link rel="stylesheet" href="/css/style.css">
<!-- scripts list from _config.yml -->
<script src="/js/frame.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<!-- hexo injector head_end start -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css">
<!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.3.0"></head>
<body>
<div class="mask-border">
</div>
<div class="wrapper">
<div class="header">
<div class="flex-container">
<div class="header-inner">
<div class="site-brand-container">
<a href="/">
暮秋小屋
</a>
</div>
<div id="menu-btn" class="menu-btn" onclick="toggleMenu()">
Menu
</div>
<nav class="site-nav">
<ul class="menu-list">
<li class="menu-item">
<a href="/">主页</a>
</li>
<li class="menu-item">
<a href="/tags/Technique/">技术</a>
</li>
<li class="menu-item">
<a href="/Projects">项目</a>
</li>
<li class="menu-item">
<a href="/categories/gallery/">日记本</a>
</li>
<li class="menu-item">
<a href="/about">关于</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="main">
<div class="flex-container">
<article id="post">
<div class="post-head">
<div class="post-info">
<div class="tag-list">
<span class="post-tag">
<a href="/tags/OCaml/">
OCaml
</a>
</span>
<span class="post-tag">
<a href="/tags/Technique/">
Technique
</a>
</span>
</div>
<div class="post-title">
OCaml News Intro
</div>
<span class="post-date">
Apr 29, 2023
</span>
</div>
<div class="post-img">
<div class="h-line-primary"></div>
</div>
</div>
<div class="post-content">
<p>这里是OCaml News,一个整合了OCaml社区以及周边生态最新信息的地方,先前一直在OCaml群内发送零散的信息,太细碎了,于是在此归纳整理,不过这一系列的更新频率是不规律的,并不遵循Weekly之类的频率,而是帖满即发。</p>
<p>总体上每一次更新分为三大类:</p>
<ol>
<li>论坛,即 <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/">discuss.ocaml.org</a> 上有趣的新帖子</li>
<li>生态,即OCaml本身或周边生态中中出现的新工具,库</li>
<li>文章,即OCaml相关的最新论文,博客文章</li>
</ol>
<p>所以:</p>
<hr>
<h1 id="???-二〇二三年四月二十九日"><a href="#???-二〇二三年四月二十九日" class="headerlink" title="??? - 二〇二三年四月二十九日"></a>??? - 二〇二三年四月二十九日</h1><h2 id="呼吁新的-opam-存储库维护者"><a href="#呼吁新的-opam-存储库维护者" class="headerlink" title="呼吁新的 opam 存储库维护者"></a>呼吁新的 opam 存储库维护者</h2><p><a target="_blank" rel="noopener" href="https://opam.ocaml.org/">OPAM</a>是OCaml的官方包管理器,它通过<a target="_blank" rel="noopener" href="https://github.com/ocaml/opam-repository">opam-repository</a>存储OCaml包,opam-repository由少数人力共同维护,以确保包的时效性、和高质量。OPAM的维护团队正在寻找新的贡献者来帮助他们维护opam-repository。</p>
<p>帮助维护opam-repository并不是OCaml或OPAM方面的专家才能参与。新加入的维护者将从审查和批准对repo的更改开始,经过几周的工作后,你可以决定留下来继续做这份工作,届时将被授予完全访问权限。</p>
<p>论坛原帖:<a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/call-for-new-opam-repository-maintainers/12041">https://discuss.ocaml.org/t/call-for-new-opam-repository-maintainers/12041</a></p>
<h2 id="Local-Type-Definition"><a href="#Local-Type-Definition" class="headerlink" title="Local Type Definition"></a>Local Type Definition</h2><p>OCaml目前并不支持类似如下的Local Type Definition:</p>
<figure class="highlight ocaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> f : <span class="built_in">unit</span> -> <span class="built_in">unit</span> = </span><br><span class="line"> <span class="keyword">fun</span> <span class="literal">()</span> -></span><br><span class="line"> <span class="keyword">let</span> <span class="keyword">type</span> t = <span class="type">A</span> | <span class="type">B</span> <span class="keyword">in</span></span><br><span class="line"> ...</span><br></pre></td></tr></table></figure>
<p>但可以通过let open一个只有t的module来实现:</p>
<figure class="highlight ocaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> f : <span class="built_in">unit</span> -> <span class="built_in">unit</span> = </span><br><span class="line"> <span class="keyword">fun</span> <span class="literal">()</span> -></span><br><span class="line"> <span class="keyword">let</span> <span class="keyword">open</span> <span class="keyword">struct</span> <span class="keyword">type</span> t = <span class="type">A</span> | <span class="type">B</span> <span class="keyword">end</span> <span class="keyword">in</span></span><br><span class="line"> ...</span><br></pre></td></tr></table></figure>
<p>其实前者可以当作后者的糖,但目前还没实现,这是相关PR: <a target="_blank" rel="noopener" href="https://github.com/ocaml/ocaml/pull/12151">Add local type definition syntax #12151</a></p>
<p>论坛原帖:<a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/local-type-definition">https://discuss.ocaml.org/t/local-type-definition</a></p>
<h2 id="使用LablGtk3实现的七个GUI示例"><a href="#使用LablGtk3实现的七个GUI示例" class="headerlink" title="使用LablGtk3实现的七个GUI示例"></a>使用LablGtk3实现的七个GUI示例</h2><p>行业中存在各种各样不同语言的GUI工具包和各种各样不同的GUI开发方式。7GUIs代表GUI编程中典型的七项任务。</p>
<p>项目页面:<a target="_blank" rel="noopener" href="https://7guis.github.io/7guis/">https://7guis.github.io/7guis/</a><br>使用LablGtk3实现的7GUIs Github连接:<a target="_blank" rel="noopener" href="https://github.com/F-loyer/7guis-ocaml-lablgtk3">https://github.com/F-loyer/7guis-ocaml-lablgtk3</a></p>
<h2 id="使用Dream编写REST-API"><a href="#使用Dream编写REST-API" class="headerlink" title="使用Dream编写REST API"></a>使用Dream编写REST API</h2><p>这篇文章是使用Dream、Yojson和Caqti的经验之谈,这篇文章的重点不是做出价值判断(X框架好,Y框架不好之类的),而是理解如何将一个工作流程转换为另一个工作流程的概念.</p>
<p>文章连接:<a target="_blank" rel="noopener" href="https://jsthomas.github.io/ocaml-dream-api.html">https://jsthomas.github.io/ocaml-dream-api.html</a></p>
</div>
<script>
window.onload = detectors();
</script>
<div class="post-footer">
<div class="h-line-primary"></div>
<nav class="post-nav">
<div class="prev-item">
<div class="icon arrow-left"></div>
<div class="post-link">
<a href="/2023/05/06/OCaml_News_20230506/">Prev</a>
</div>
</div>
<div class="next-item">
<div class="icon arrow-right"></div>
<div class="post-link">
<a href="/2023/04/25/%E4%BA%8C%E9%9B%B6%E4%BA%8C%E4%B8%89%E5%B9%B4%E5%9B%9B%E6%9C%88%E4%BA%8C%E5%8D%81%E4%BA%94%E6%97%A5/">Next</a>
</div>
</div>
</nav>
</div>
<div class="post-comment">
</div>
</article>
</div>
</div>
<div class="footer">
<div class="flex-container">
<div class="footer-text">
|
希望路过的人可以添点柴火让这里暖和点
</div>
</div>
</div>
</div>
</body>
</html>
|