Reputation: 2917
Lets say you have
data SS=
SSliteral Value
and
data Value=
SSint Int
Now lets say you have n
which is of type SS
. You want to get the Int
value of SS
, how would you go about doing so?
Upvotes: 1
Views: 2099
Reputation: 13042
We define with record syntax:
data SS = SSliteral {
ssValue :: Value
}
data Value = SSint {
ssInt :: Int
}
now we define
getIt :: SS -> Int
getIt = ssInt . ssValue
And now we are point-free.
Upvotes: 1