Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  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. a = Record1{"Charlie"}
  17. print record1Name a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement