packages feed

Snusmumrik-0.0.1: Views.hs

module Views where

import Book

-- | File system entry.
data PathElement = LibDir String | LibFile Book | StubFile String
  deriving (Eq)

instance Show PathElement where
  show (LibDir  dir)  = dir
  show (LibFile book) = bookFileName book
  show (StubFile s)   = s

-- | Type of directory view (what is its contents).
data View = Author | Title | Genre | Lang | AuthorInitial

instance Show View where
  show Author = "Author"
  show Title = "Title"
  show Genre = "Genre"
  show Lang = "Lang"
  show AuthorInitial = "AuthorInitial"