我有一个功能:
isItSimple :: Int -> Bool
Run Code Online (Sandbox Code Playgroud)
它获得了Int并返回Bool.
我需要在[x |中找到第一个数字 x < - [ n .. ],isItSimple x].
这是我的解决方案:
findIt :: Int -> Int
findIt num
| isItSimple num = num
| otherwise = findIt (num + 1)
Run Code Online (Sandbox Code Playgroud)
在Haskell中有更好的解决方案吗?