
I have a question related to using Writer with a user defined datatype where I want some of the fields to append and others to just take the last value as a reduced example, if I had a data type like this: data Mydat = Mydat {list1 :: [String], item1 :: Float} and I wanted a Writer MyDat a where the strings keep on appending, but the float value just takes the last value. would I have to define Float as an instance of Monoid like instance Monoid Float where mempty = 0.0 mappend a b = a ?or maybe mappend a b = b before defining an instance of MyDat Or can I do something like instance Monoid MyDat where mempty = Mydat [] 0 mappend a b = (Mydat (mappend (list1 a) (list1 b)) (item1 a)) without defining an instance for Float? Thank you, Britt