mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2025-01-05 20:04:49 +03:00
Add TH combinator maybeD.
This commit is contained in:
parent
f52371e0ad
commit
d92fc81b1f
@ -4,7 +4,7 @@ module Language.Haskell.TH.Name.Extra (
|
||||
|
||||
compileErrorIO, compileError,
|
||||
|
||||
integralE, simpleValD
|
||||
integralE, simpleValD, maybeD
|
||||
) where
|
||||
|
||||
import Language.Haskell.TH
|
||||
@ -32,3 +32,6 @@ simpleValD var typ expr = do
|
||||
sig <- sigD var typ
|
||||
val <- valD (varP var) (normalB expr) []
|
||||
return [sig, val]
|
||||
|
||||
maybeD :: (a -> Q [Dec]) -> Maybe a -> Q [Dec]
|
||||
maybeD = maybe (return [])
|
||||
|
Loading…
Reference in New Issue
Block a user