我有这一点:
0.00049 1.509
0.00098 1.510
0.00195 1.511
0.00293 1.509
0.00391 1.510
0.00586 1.523
0.00781 1.512
0.01172 1.514
0.01562 1.510
0.02344 1.511
0.03125 1.510
0.04688 7.053
0.06250 7.054
0.09375 7.187
0.125 7.184
0.1875 7.177
0.25 7.207
0.375 16.588
0.5 24.930
0.75 39.394
1 56.615
1.5 77.308
2 84.909
3 89.056
4 88.485
6 88.678
8 89.022
12 88.513
16 88.369
24 88.512
32 88.536
48 87.792
64 87.716
96 87.589
128 87.608
192 87.457
256 87.388
Run Code Online (Sandbox Code Playgroud)
这个gnuplot脚本:
#! /usr/bin/gnuplot
set terminal …Run Code Online (Sandbox Code Playgroud) 假设我们有一个名为Stuff的数据:
data Stuff = Stuff1 Int
| Stuff2 Int
| Stuff3 Int
sumStuff :: [Stuff] -> Int
sumStuff [] = 0
sumStuff ((Stuff1 x):xs) = x + sumStuff xs
sumStuff ((Stuff2 x):xs) = x + sumStuff xs
sumStuff ((Stuff3 x):xs) = x + sumStuff xs
sumStuff' :: [Stuff] -> Int
sumStuff' [] = 0
sumStuff' ((_ x):xs) = x+sumStuff xs
Run Code Online (Sandbox Code Playgroud)
如何在没有模式匹配的情况下匹配所有类型,如sumStuff'中的错误定义?
先感谢您!
当我做这样的断言时:
assert(-color(red)).
Run Code Online (Sandbox Code Playgroud)
它给了我错误:
ERROR: assert/1: No permission to modify static procedure `(-)/1'
Run Code Online (Sandbox Code Playgroud)
所以我将 -color 更改为动态:
dynamic -color/4.
Run Code Online (Sandbox Code Playgroud)
现在它给了我错误:
ERROR: dynamic/1: Type error: `atom' expected, found `-color'
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?