3 ms·
From the Haskell snippet, f is just "map read" specialized for lists of Integers, so inlining it would read like this : let list = map read (words contents)
by trealira 2y ago
From the Haskell snippet, f is just "map read" specialized for lists of Integers, so inlining it would read like this :
let list = map read (words contents)
The equivalent Python is basically this:
list = [int(word) for word in contents.split()]
I'm just writing this for the benefit of others here.