我今天就開始在哈斯克爾,並且我在ghci上執行的所有功能都顯示此消息。我只是想知道這是爲什麼happenning.I知道,存在很多關於這個問題,但是這是一個簡單的例子,我需要知道這個錯誤在開始時 function3 :: Int -> [Int]
function3 x = [a | a <- [1..x] mod a x == 0]
此代碼適用於教科書中的練習。 如果我定義 minmax :: (Ord a, Show a) => [a] -> Maybe (a, a)
minmax [] = Nothing
minmax [x] = Just (x, x)
minmax (x:xs) = Just (if x < xs_min then x else xs_min
, if x > xs_max th
要看到在Haskell GHCI函數的簽名,我有:t前綴是: Prelude> f = \x -> x+1
Prelude> :t f
f :: Num a => a -> a
但輸入前綴每一次成長迅速歲。如果我離開它,我得到錯誤: Prelude> f
<interactive>:5:1: error:
• No instance for (Show (a0 -> a0)) ari
我這是在玩弄代碼: *Main DepthFirstSearch DivideAndConquer Fibonacci LongestEdgePathInDAG> let x = Data.Map.empty
*Main DepthFirstSearch DivideAndConquer Fibonacci LongestEdgePathInDAG> let y = Data.Map.inser