data type 定义后的小问题
haskell吧
全部回复
仅看楼主
level 1
Moeboss 楼主
data Instructions
= Move Distance Instruction
| Turn Angle Instructions
| Setcolour Colour Instructions
| Stop
这样一个定义用来描述一个图形的运动轨迹
假设我们有 Move 100 Stop 和 Ture 45 Stop 两个instructions
我想写一个 方程 combinator:: instructions -> instructions-> instruction
来通过输入两个instructions 来得到 Move 100 Ture 45 Stop 这样一个instructions
2020年06月24日 07点06分 1
level 3
2020年06月24日 16点06分 2
哇啊哇哇谢谢谢谢太谢谢了,简直救命恩人
2020年06月25日 02点06分
1