Artificial intelligent assistant

データ型の1番目の要素にアクセスするにはどうすればいいんでしょうか? - Haskell `` : > > data Person = Person { name :: String, age :: Int } > > taro = Person { name = "Taro", age = 25 } > > main = do print $ name taro -- : "Taro" > print $ age taro -- : 25 > **** **Bar.hs** % docker run -it --rm --name bar-haskell -v "$PWD":/tmp -w /tmp haskell:8 runghc Bar.hs : "Taro" 25 > > data Shape = Rect Double Double > > area :: Shape -> Double > area(Rect x y)= x * y > > main = print $ area(Rect 2 3) -- : 6.0 > 1 Double , `name taro` `x * y`x

`Rect`




getX :: Shape -> Double
getX (Rect x _) = x





getX :: Shape -> Double
getX (Rect x y) = x


`y`GHC

`getX` `Person`

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 0ec891fc68768ce33afae086af46fb0e