Safe Haskell | None |
---|---|
Language | Haskell2010 |
(.Internal
modules may violate the PVP)
- data DeriveListConfig = DeriveListConfig {
- _getEmptyName :: String -> String
- _getAppendName :: String -> String
- _getToListName :: String -> String
- data DeriveListNames = DeriveListNames {}
- deriveList :: Name -> Name -> DecsQ
- deriveMonoid :: Name -> Name -> DecsQ
- deriveSemigroup :: Name -> Name -> DecsQ
- deriveIsList :: Name -> Name -> DecsQ
- deriveListWith :: DeriveListConfig -> Name -> Name -> DecsQ
- deriveMonoidWith :: DeriveListConfig -> Name -> Name -> DecsQ
- deriveSemigroupWith :: DeriveListConfig -> Name -> Name -> DecsQ
- deriveIsListWith :: DeriveListConfig -> Name -> Name -> DecsQ
- deriveSemigroup_ :: DeriveListNames -> DecsQ
- deriveMonoid_ :: DeriveListNames -> DecsQ
- deriveIsList_ :: DeriveListNames -> DecsQ
- makeEmpty :: DeriveListNames -> DecsQ
- makeAppend :: DeriveListNames -> DecsQ
- makeToList :: DeriveListNames -> DecsQ
- makeDeriveListNames :: DeriveListConfig -> Name -> Name -> DeriveListNames
- defaultDeriveListConfig :: DeriveListConfig
Documentation
data DeriveListConfig Source
DeriveListConfig | |
|
deriveListWith :: DeriveListConfig -> Name -> Name -> DecsQ Source
deriveMonoidWith :: DeriveListConfig -> Name -> Name -> DecsQ Source
deriveSemigroupWith :: DeriveListConfig -> Name -> Name -> DecsQ Source
derives Semigroup
only.
deriveIsListWith :: DeriveListConfig -> Name -> Name -> DecsQ Source
derives IsList
only.
deriveSemigroup_ :: DeriveListNames -> DecsQ Source
needs no constraints.
assumes makeAppend
deriveMonoid_ :: DeriveListNames -> DecsQ Source
needs no constraints.
assumes makeAppend
, makeEmpty
deriveIsList_ :: DeriveListNames -> DecsQ Source
needs no constraints.
assumes makeToList
makeEmpty :: DeriveListNames -> DecsQ Source
PatternSynonyms
won't work until https://ghc.haskell.org/trac/ghc/ticket/8761
makeAppend :: DeriveListNames -> DecsQ Source
assumes makeToList
makeToList :: DeriveListNames -> DecsQ Source
makeDeriveListNames :: DeriveListConfig -> Name -> Name -> DeriveListNames Source
can debug deriveList
with:
print $ makeDeriveListNames defaultDeriveListConfig
''T 'C
defaultDeriveListConfig :: DeriveListConfig Source
by default, the functions generated for a type T
are "emptyT"
and "toTList"
.