lymar / hastache

Haskell implementation of Mustache template
Other
96 stars 16 forks source link

Merging contexts #31

Closed angerman closed 10 years ago

angerman commented 10 years ago

Is it possible to merge contexts? Say merge a mkStringContext with a mkGenericContext?

co-dan commented 10 years ago

Right now it is not possible to do that, but it seems like an interesting idea. I think it is possible to implement that, but we need to think throughoutly about the specification.

co-dan commented 10 years ago

@angerman what do you think of this idea: https://github.com/lymar/hastache/commit/1f3b52d49f818c336395b84c7539da6f83e16d57?

co-dan commented 10 years ago

I am actually thinking it would be a better idea NOT to define a monoid instance, but just the contextCompose function.

co-dan commented 10 years ago

So, I went ahead and pushed the changes to master. I will be releasing 0.6.1 with composeCtx function soon, if everything goes smoothly.