14
votes

Tried to use (.) for function composition, but it doesn't work.

import Data.String (length, trim)

trimmedLength :: String -> Int
trimmedLength = length . trim
1

1 Answers

15
votes

Function composition in PureScript is done with (<<<), not (.).

import Data.String (length, trim)

trimmedLength :: String -> Int
trimmedLength = length <<< trim