dontexist
dontexist

Reputation: 5642

How do you compose functions in PureScript?

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

import Data.String (length, trim)

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

Upvotes: 17

Views: 1910

Answers (1)

dontexist
dontexist

Reputation: 5642

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

import Data.String (length, trim)

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

Upvotes: 19

Related Questions