import Data.Semigroup

main = putStrLn "Hello"

data Preference = Blacklisted
                | Like Integer
                deriving (Show)

instance Semigroup Preference where
    Like a <> Like b = Like (a+b)
    _      <> _      = Blacklisted

-- Notes:
-- We should not allow duplicate restaurantIds
-- http://goto.ucsd.edu/~rjhala/liquid/haskell/blog/about/
data Restaurant = Restaurant { restaurantId   :: Integer
                             , restaurantName :: String
                             } deriving (Show)

-- Notes:
-- We should not allow duplicate personIds
-- http://goto.ucsd.edu/~rjhala/liquid/haskell/blog/about/
data Person = Person { personId   :: Integer
                     , personName :: String
                     } deriving (Show)

-- Notes:
-- We should not allow one person to have multiple preferences for the same
-- restaurant.
-- http://goto.ucsd.edu/~rjhala/liquid/haskell/blog/about/
data PersonPreference = PersonPreference { person     :: Person
                                         , restaurant :: Restaurant
                                         , preference :: Preference
                                         } deriving (Show)

data LunchOption = LunchOption { restaurantOption :: Restaurant
                               , totalPreference  :: Preference
                               } deriving (Show)

filterRestaurants :: [PersonPreference] -> [LunchOption]
filterRestaurants = preferencesToLunchOptions . filterBlacklisted

preferencesToLunchOptions :: [PersonPreference] -> [LunchOption]
preferencesToLunchOptions = _hole4

preferenceToOption :: PersonPreference -> LunchOption
preferenceToOption = _hole5

-- Notes:
-- This should only be allowed to combine lunch options for the same
-- restaurant
combineLunchOptions :: LunchOption -> LunchOption -> LunchOption
combineLunchOptions = _hole6

-- This is a good example of using QuickCheck
filterBlacklisted :: [LunchOption] -> [LunchOption]
filterBlacklisted = _hole2
