小编gof*_*rie的帖子

在Haskell中交织函数定义

我正在编写一些相互递归的模式匹配函数,我希望能够将它们的定义交错

recA [pattern ...] = [.. something that might call recB with the next pattern ..]
recB [pattern ...] = ...
recA [other ...]   = ...
...b
Run Code Online (Sandbox Code Playgroud)

这可能吗?还有一些更惯用的选择吗?

haskell

1
推荐指数
1
解决办法
157
查看次数

标签 统计

haskell ×1