有时我会写这样的代码
solveLogic :: Int -> Int -> Int
solveLogic a b =
let
x = 1
brainiac
| a >= x = 1
| a == b = 333
| otherwise = 5
in
brainiac
每次我都想在没有不需要的“brainiac”功能的情况下写这些东西,就像这样:
solveLogic :: Int -> Int -> Int
solveLogic a b =
let
x = 1
in
| a >= x = 1
| a == b = 333
| otherwise = 5
哪个代码更“Haskellish”。有没有办法做到这一点?