Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 207
ahstro Avatar asked Sep 16 '17 11:09

ahstro


1 Answers

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

import Data.String (length, trim)

trimmedLength :: String -> Int
trimmedLength = length <<< trim
like image 91
ahstro Avatar answered Oct 17 '22 06:10

ahstro