F# compiler error FS0030, problems with the Value Restriction

北战南征 提交于 2019-12-01 09:05:24

Well, I messed around a bit and found the solution, in desperation, but I'm not sure that I understand why...

let toleq (e:float<_>) (a:float<_>) (b:float<_>) = (abs ( a - b ) ) < e

Ugh, it's almost as ugly as generic declarations in C#.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!