【发布时间】:2014-05-09 14:24:56
【问题描述】:
我有这个错误请你们帮帮我
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
【问题讨论】:
标签: haskell