Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --various imports go here,
  2.  
  3. data Record1' = Record1' {_name :: String}
  4. data Record2' = Record2' {_name :: String}
  5.  
  6. fillBlanks :: String -> DecsQ
  7. fillBlanks input = wrangle ''(mkName x ++ ') defWrangleOpts{
  8.    fieldLabelModifier = (\label -> x ++ ' ++ uppercaseFirst (init label)),
  9.     typeNameModifier = (\name -> head name)}
  10.  
  11. uppercaseFirst [] = []
  12. uppercaseFirst (c:cs) = toUpper c : cs
  13.  
  14. fmap fillBlanks ["Record1", "Record2"]
  15.  
  16.  
  17. main :: IO()
  18. main = do
  19.     a = Record1{"Charlie"}
  20.     print record1Name a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement