Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This is part of the setup and should not be changed
- -- D and T are type synonyms for Bytestring and I is a type Synonym for Word
- data TItem = TItem
- { tiI :: !I
- , tiD :: !D
- , tiT :: ![T]
- } deriving (Show, Eq, Ord)
- class MTL m where
- add :: D -> [T] -> m I
- --
- data TL = TL {
- list :: [TIitem]
- }
- deriving (Show, Eq)
- emptyTList :: TL
- emptyTList = TL []
- -- This is part of the setup and should not be changed
- newtype TLM a = TLM { runTLM :: StateT TL IO a }
- deriving (Functor, Applicative, Monad, MonadIO)
- --
- instance MTL TLM where
- --add :: D -> [T] -> StateT TL IO I --Filled in TLM to get this type but that might be the problem I'm having
- add desc tags = do
- i <- gets nextIndex
- putStrLn (show i)
- return i
- where nextIndex (TL []) = 0
- nextIndex (TL (x:_)) = (tiI x) + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement