0
我有這個錯誤你們可以幫助我,請哈斯克爾無法比擬預期型
Couldn't match expected type `Pixels' with actual type `[b0]'
In the return type of a call of `map'
In the expression: map (map cambio) b
In an equation for `negative':
negative (Pixels _ b)
= map (map cambio) b
where
cambio True = False
cambio False = True
Failed, modules loaded: none.
這是代碼:
import qualified Graphics.HGL as G
import qualified Data.Bool
data Pixel = Pixel { on :: Bool }
data Pixels = Pixels { color :: G.Color, dots :: [[Pixel]] }
negative:: Pixels -> Pixels
negative (Pixels _ b) = map (map cambio) b
where
cambio True = False
cambio False = True