小编Dmi*_*hus的帖子

如何在最终无标签方法中重新解释DSL术语?

今天是个好日子.

我们的应用程序使用类型化的DSL来描述某些业务逻辑.DSL附带了几个无标记的解释器.

以下是其术语的声明方式:

{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE EmptyDataDecls #-}

class Ctl impl where
  -- Lift constants.
  cnst :: Show t => t -> impl t
  -- Obtain the state.
  state :: impl (Maybe Int)

  -- Test for equality.
  eq :: impl Int -> impl Int -> impl Bool
  -- If-then-else.
  ite :: impl Bool -> impl t -> impl t -> impl t

  -- Processing outcomes.
  retry :: impl Outcome
  finish :: impl Outcome

  -- Require a value. …
Run Code Online (Sandbox Code Playgroud)

dsl haskell

7
推荐指数
1
解决办法
648
查看次数

标签 统计

dsl ×1

haskell ×1