相关疑难解决方法(0)

Typed abstract syntax and DSL design in Haskell

I'm designing a DSL in Haskell and I would like to have an assignment operation. Something like this (the code below is just for explaining my problem in a limited context, I didn't have type checked Stmt type):

 data Stmt = forall a . Assign String (Exp a) -- Assignment operation
           | forall a. Decl String a          -- Variable declaration 
 data Exp t where
    EBool   :: Bool -> Exp Bool
    EInt    :: Int  -> Exp Int
    EAdd    :: Exp Int …
Run Code Online (Sandbox Code Playgroud)

dsl haskell language-design dependent-type

4
推荐指数
1
解决办法
726
查看次数

标签 统计

dependent-type ×1

dsl ×1

haskell ×1

language-design ×1