I have the following data type definition:
newtype Combine a b = Combine { unCombine :: a -> b }
and then I can define the following:
Prelude> let f = Combine $ \n -> Sum (n + 1)
My question is how to use f ?
f
Prelude Data.Monoid> unCombine f 1 Sum {getSum = 2} Prelude Data.Monoid> unCombine f 42 Sum {getSum = 43}