I have been trying to ask in IRC but my internet connection has been so shotty I am missing replies and failing silently.
Anyway, I am pretty sure this code will 'smell very bad' ; but I also believe it would do what I wanted it to do if Entity was an instance of Ord.
I don't actually care what they are ordered by so long as it is consistent, so I thought of just making sure Entity was ordering by the key.
Is this bad?
and a synopsis of what I am trying to do:
I have two lists of tuples, specifically a [(Entity Player,[Entity GamingSessions])] and a [(Entity Player,[Entity ManualSession])]
What I want out of it all is a 7 tuple for being consumed by a hamlet file:
[(Entity Player, [Entity GamingSession], [Entity ManualSession], EarnedMinutes, EarnedPoints, GivenMinutes, GivenPoints)]
where these are all derived from the [Entity GamingSession] and [Entity ManualSession] :
type EarnedMinutes = Int
type GivenMinutes = Int
type EarnedPoints = Double
type GivenPoints = Double
The 'problem' is that the two lists don't necessarily have the same Entity Players, so I want to make a union as if Entity Player were the index. So I wrote code to do that and called it marry' in the hpaste
The code relies on the two lists being sorted, and seeing if it should "take" from the head of: one list, the other list, or both lists-- in creating the next element of the list of 7-tuples