SHARE
TWEET

Untitled

a guest Mar 14th, 2010 190 Never
  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}
RAW Paste Data
Top