diff --git a/src/Data/Queue.hs b/src/Data/Queue.hs deleted file mode 100644 index 7393b2c..0000000 --- a/src/Data/Queue.hs +++ /dev/null @@ -1,25 +0,0 @@ --- | --- Module: Queue --- Description: A simple functional Queue --- Stability: experimental -module Data.Queue where - - data Queue a = Queue [a] [a] - deriving (Show) - - instance Foldable Queue where - foldr f a (Queue xs ys) = foldr f a (xs ++ (reverse ys)) - - enqueue :: Queue a -> a -> Queue a - enqueue (Queue xs ys) a = Queue (a:xs) ys - - dequeue :: Queue a -> (Queue a,Maybe a) - dequeue q@(Queue [] []) = (q,Nothing) - dequeue q@(Queue xs (y:ys)) = (Queue xs ys, Just y) - dequeue q@(Queue xs@(t:ts) []) = let ys = reverse xs in (Queue [] (tail ys), Just (head ys)) - - isEmpty :: Queue a -> Bool - isEmpty (Queue [] []) = True - isEmpty _ = False - - diff --git a/src/Lib.hs b/src/Lib.hs deleted file mode 100644 index d36ff27..0000000 --- a/src/Lib.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Lib - ( someFunc - ) where - -someFunc :: IO () -someFunc = putStrLn "someFunc"