Indeed, with type information you can do quite sophisticated embedded DSLs that heavily reuse the host language's infrastructure for variables, control and types.
So no need for the LpVariable stuff, for example, and you get type safety.
An example of an SMT solver DSL, which:
* reuses Haskell's type checker to check the types of the embedded language,
* uses Haskell's polymorphism to add polymorphism to the underlying language
* and the host language's variables as target language variables.
So no need for the LpVariable stuff, for example, and you get type safety.
An example of an SMT solver DSL, which:
* reuses Haskell's type checker to check the types of the embedded language,
* uses Haskell's polymorphism to add polymorphism to the underlying language
* and the host language's variables as target language variables.
http://code.haskell.org/~dons/docs/yices-painless/Yices-Pain...