module SlowQueue where ------------------------------------------------------------------ empty :: Q a add :: a -> Q a -> Q a remove :: Q a -> Q a front :: Q a -> a isEmpty :: Q a -> Bool ------------------------------------------------------------------ data Q a = Q [a] deriving (Eq, Show) empty = Q [] add x (Q xs) = Q (xs++[x]) remove (Q (x:xs)) = Q xs front (Q (x:xs)) = x isEmpty (Q xs) = null xs ------------------------------------------------------------------