[Added EmbedAsAttr which allows you to embed attribute values that are in the XMLGenT monad Jeremy Shaw **20100524180525 Ignore-this: cc171b5a5d3a0206118e4835203cc403 As describe in this thread: http://groups.google.com/group/happs/browse_thread/thread/bcc11209716b8126 We sometimes wish to write code like this: page = ... foo fooURL = XMLGenT m String fooURL = return "http://example.org/foo" where the value of an attribute is calculated inside the XMLGenT monad. We already have this instance for EmbedAsChild: instance (EmbedAsChild m c, TypeCastM m1 m) => EmbedAsChild m (XMLGenT m1 c) We add a similar instance for EmbedAsAttr: instance (EmbedAsAttr m (Attr a v), TypeCastM m1 m) => EmbedAsAttr m (Attr a (XMLGenT m1 v)) ] hunk ./src/HSX/XMLGenerator.hs 104 +instance (EmbedAsAttr m (Attr a v), TypeCastM m1 m) => EmbedAsAttr m (Attr a (XMLGenT m1 v)) where + asAttr (a := (XMLGenT m1a)) = do + v <- XMLGenT $ typeCastM m1a + asAttr (a := v) +