File: DeriveDSL.hs

package info (click to toggle)
haskell-derive 2.5.16-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 460 kB
  • sloc: haskell: 3,686; makefile: 5
file content (21 lines) | stat: -rw-r--r-- 455 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

module Data.DeriveDSL(DSL, deriveDSL, applyDSL, dynamicDSL) where

import Data.Derive.DSL.Derive
import Data.Derive.DSL.Apply
import Data.Derive.DSL.DSL
import Data.Derive.DSL.HSE
import Data.Derive.DSL.SYB
import Data.Maybe


deriveDSL :: [Decl] -> Maybe DSL
deriveDSL = listToMaybe . derive


applyDSL :: DSL -> DataDecl -> Either String [Decl]
applyDSL dsl inp = Right $ apply dsl $ toInput inp


dynamicDSL :: DSL -> Maybe [Decl]
dynamicDSL = dslSYB