Created
March 19, 2018 03:00
-
-
Save khibino/53bece35a8d9bbb226a54b17aeeb6d7f to your computer and use it in GitHub Desktop.
Name configuration example of Haskell Relational Record
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Language.Haskell.TH (nameBase) | |
import Language.Haskell.TH.Name.CamelCase (varCamelcaseName, varName) | |
import Database.Record.TH | |
customConfig :: NameConfig | |
customConfig = | |
defaultNameConfig | |
{ columnName = \tbl col -> varCamelcaseName $ tbl ++ "_" ++ col } | |
main :: IO () | |
main = | |
putStrLn . nameBase . varName | |
$ columnName customConfig "table_foo" "column_bar" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment