2017-09-16 111 views

回答

4

功能組合物與(<<<),不(.)完成。

import Data.String (length, trim) 

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

這是冗長的。不是puresript支持unicode,因此可能有'?'? – ftor

+1

是的,它只是沒有包含在覈心'Prelude'中。如果項目特定的前奏對象適合unicode友好的項目,通常會定義它。 –

+0

就在幾分鐘前,還有一家圖書館(迄今爲止)只做這件事 - [purescript-gorgeous](https://github.com/slamdata/purescript-gorgeous) - 儘管它還沒有在追蹤中發佈。 – ahstro