From 9ca133ca56f02e714bc34b5bbafb074d45ad1151 Mon Sep 17 00:00:00 2001 From: Dennis Frieberg Date: Wed, 26 Aug 2020 16:14:09 +0200 Subject: [PATCH] did some cleanup --- src/Data/Queue.hs | 25 ------------------------- src/Lib.hs | 6 ------ 2 files changed, 31 deletions(-) delete mode 100644 src/Data/Queue.hs delete mode 100644 src/Lib.hs 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"