dailyCost :: Map.Map [Char] Double -> LinFunc [Char] Double
dailyCost loadPattern = let
    periods = Map.keys loadPattern
    
    --cost of reserving an instance
    reservationFixedCostsObj = [ ( cost/365.0, "reservation_" ++ kind)
                                | (kind, cost) <- reservationFixedCosts ] 
    -- cost of *running* the reserved instance. 
    reservationVariableCostsObj = [ (cost*8, "reserved_" ++ kind ++ "_" ++ period)
                                  | (kind, cost) <- reservationVariableCosts,
                                  period <- periods ]
    -- cost of running on-demand instances
    onDemandVariableCostsObj = [ (onDemandHourlyCost*8, "onDemand_" ++ p) |p <- periods ]

    in
    linCombination (reservationFixedCostsObj ++ reservationVariableCostsObj ++ onDemandVariableCostsObj)
dailyCost :: Map.Map [Char] Double -> LinFunc [Char] Double
dailyCost loadPattern = let
    periods = Map.keys loadPattern
    
    --cost of reserving an instance
    reservationFixedCostsObj = [ ( cost/365.0, "reservation_" ++ kind)
                                | (kind, cost) <- reservationFixedCosts ] 
    -- cost of *running* the reserved instance. 
    reservationVariableCostsObj = [ (cost*8, "reserved_" ++ kind ++ "_" ++ period)
                                  | (kind, cost) <- reservationVariableCosts,
                                  period <- periods ]
    -- cost of running on-demand instances
    onDemandVariableCostsObj = [ (onDemandHourlyCost*8, "onDemand_" ++ p) |p <- periods ]

    in
    linCombination (reservationFixedCostsObj ++ reservationVariableCostsObj ++ onDemandVariableCostsObj)
dailyCost loadPattern = let
    periods = Map.keys loadPattern
    
    --cost of reserving an instance
    reservationFixedCostsObj = [ ( cost/365.0, "reservation_" ++ kind)
                                | (kind, cost) <- reservationFixedCosts ] 
    -- cost of *running* the reserved instance. 
    reservationVariableCostsObj = [ (cost*8, "reserved_" ++ kind ++ "_" ++ period)
                                  | (kind, cost) <- reservationVariableCosts,
                                  period <- periods ]
    -- cost of running on-demand instances
    onDemandVariableCostsObj = [ (onDemandHourlyCost*8, "onDemand_" ++ p) |p <- periods ]

    in
    linCombination (reservationFixedCostsObj ++ reservationVariableCostsObj ++ onDemandVariableCostsObj)