Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 14th, 2010  |  syntax: Haskell  |  size: 0.28 KB  |  views: 187  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. data MyData = MyData {
  2.       a :: Int,
  3.       b :: Int,
  4.       c :: Int
  5.     } deriving (Show)
  6.            
  7. def = MyData 1 2 3
  8.  
  9. makeMyData :: Int -> Int -> MyData
  10. makeMyData a' b' = def { a = a', b = b'}
  11.  
  12. myData1 = (makeMyData 9 10) {a = 1}
  13. myData2 = (makeMyData 11 12) {c = 12}
clone this paste RAW Paste Data