一個 「做」 語法中我知道這個工程: do name <- getLine; let nameTag = "Hello, my name is " ++ name in putStrLn nameTag
除了這段代碼在加載到GHCI: hey = do
name <- getLine
let nameTag = "Hello, my name is " ++ name
我有以下函數返回雙因子對於給定數目 factorPairs:: (RealFrac a, Floating a, Integral a) => a -> [(a, a)]
factorPairs n = map(\x -> (x, div n x)) [y | y <- [1..(ceiling $ sqrt n)], n `rem` y == 0]
當我打電話了ghci factorPai