I'm trying to achieve a point free version of the following example:
data Person = Person String Int deriving ( Show, Eq )
data Animal = Animal Person deriving ( Show, Eq )
f :: String -> Int -> Animal
f s = Animal . Person s
-- f = Animal . Person -- [ 1 ]
-- f = Animal $ Person -- [ 2 ]
-- f = Animal . (uncurry Person) . (,) -- [ 3 ]
main = print (f "ppp" 8)
- Cancelling just the
Intis easy, but I can't get rid of the strings(attempts above) - This is a bit weird (?), because attempt
[ 1 ]simply "peels off" a rightmosts