Herumspielen in ghci
ich den folgenden Ausdruck bekam: unlines . map (\(a,b) -> show a ++ " " ++ show b)
Warum Unterschrift Wechsel nach einer Zuweisung
Nun, wenn ich es über :t
überprüfen ich:
> :t unlines . map (\(a,b) -> show a ++ " " ++ show b)
unlines . map (\(a,b) -> show a ++ " " ++ show b)
:: (Show a, Show a1) => [(a, a1)] -> String
So genau wie erwartet. Aber jetzt, wenn ich versuche, es zu einem gewissen Namen zuweisen, erhalte ich eine spezifische Signatur als das Original:
> let f = unlines . map (\(a,b) -> show a ++ " " ++ show b)
> :t f
f :: [((),())] -> String
Warum geschieht das?
Siehe auch: [1] (http://stackoverflow.com/questions/7055146), [2] (http://stackoverflow.com/questions/11439163), [3] (http: // stackoverflow. com/questions/9714697), [4] (http://stackoverflow.com/questions/8434808), [5] (http://stackoverflow.com/questions/7799345), [6] (http: // stackoverflow .com/questions/8262020), [7] (http://stackoverflow.com/questions/8655900), [8] (http://stackoverflow.com/questions/11003535). Ich bin mir ehrlich gesagt nicht sicher, welche (wenn überhaupt) von diesen ein Duplikat von. –