[Haskell-cafe] Design of a DSL in Haskell

Stephen Tetley stephen.tetley at gmail.com
Tue Dec 4 18:49:54 CET 2012


In Haskell, shallow DSLs generate values - deep DSLs generate
structures (typically abstract syntax trees), the structure can
subsequently be used to generate a value (or a C program, or a HTML
page, etc.).

See Andy Gill and colleagues "Types and Type Families for Hardware
Simulation and Synthesis, The Internals and Externals of Kansas Lava"
for a fuller definition.

http://www.ittc.ku.edu/csdl/fpg/sites/default/files/Gill-10-TypesKansasLava.pdf

Other communities may have their own definitions.

On 4 December 2012 10:01, Kim-Ee Yeoh <ky3 at atamo.com> wrote:
> On Tue, Dec 4, 2012 at 4:53 PM, Joerg Fritsch <fritsch at joerg.cc> wrote:
>> is a shallow embedded DSL == an internal DSL and a deeply embedded DSL ==
>> an external DSL or the other way around?
>
> Roughly speaking, yes. But a deep DSL doesn't mean you've got to have a
> parser << tokenizer << IO input. You can get a deep DSL merely from the free
> monad construction.
>
> -- Kim-Ee



More information about the Haskell-Cafe mailing list