Haskell fmap functor
<p>I have a problem with functors over queue based on designated algebraic datastructures. </p>

<pre><code>data DQueue a = Empty | Enqueue a (DQueue a)
    deriving (Eq, Show, Read)


instance Functor DQueue
  where
    fmap f (Enqueue x xs) = Enqueue (f x) $ fmap f xs

instance Foldable DQueue
  where
    foldr = error "not done"

sample1 :: DQueue Int
sample1 =  Enqueue 5 $ Enqueue 7 $ Enqueue 9 Empty
</code></pre>

<p>and result should be like that:</p>

<pre><code>fmap (+1) sample1 ~?= Enqueue 6 (Enqueue 8 (Enqueue 10 Empty))
foldr (+) 0 sample1 ~?= 24
</code></pre>

<p>fmap seems to be logicaly correct but I get an error:
Non-exhaustive patterns in function fmap</p>

<p>Thank you in advance.</p>