The data type Restriction should be
Shape -> Bool.
you don't then need
confirm, and you can use
False instead of
notTooBig because then it's true when the data's OK. I feel that makes more sense.
notTooBig:: Shape -> Bool
notTooBig n (Shape _ dimensions _) = all smallenough dimensions where
smallenough (h,w) = h <=n && w <= n
_ means ignore this bit - we don't need the colour or description.
edit: It seems to be very important for you to have
false::Restriction -- the restriction fails
so let's make a data type
Restriction to suit you:
data ARestriction = ColourR (Colour -> Bool) -- (sorry I can't resist using British spelling)
| HeightR (Height -> Bool) -- (Hight is surely a typo)
| WidthR (Width -> Bool)
| DesR (Des -> Bool)
type Restrictions = [ARestriction]
so for example, you could have
[ColourR (=="red"), WidthR (>7)] which would only allow red things wider than 7.
confirm1 :: ARestriction -> Shape -> Bool
confirm1 (ColourR check) (Shape c ds d) = check c
confirm1 (HeightR check) (Shape c ds d) = all check $ map fst ds
confirm1 (WidthR check) (Shape c ds d) = all check $ map snd ds
confirm1 (DesR check) (Shape c ds d) = check d
confirm :: Restrictions -> Shape -> Bool
confirm rs s = all (flip confirm1 s) rs
anyway, we can use this like this:
confirm [ColourR (=="red"), WidthR (>7)] (Shape "red" [(2,3),(3,4)] "square")
which gives you
You also wanted to define
false, but let's try
true :: Restrictions
true = 
This works because all of the restrictions in the list are satisfied.
You can also define
false :: Restrictions
false = ColourR (const False)
which checks the colour of a shape, but
constantly tells you