class Listy a b where
fromList :: [b] -> a
toList :: a -> [b]
lifted :: ([b] -> [b]) -> (a -> a)
lifted f = fromList . f . toList
data MyString = MyString { getString :: String } deriving Show
instance Listy MyString Char where
toList = getString
fromList = MyString
现在我需要写 eg lifted (reverse::(String -> String)) (MyString "Foobar")
。是否有避免需要类型签名的技巧?