2
試圖使用(.)
作爲函數組合,但它不起作用。在PureScript如何在PureScript中編寫函數?
import Data.String (length, trim)
trimmedLength :: String -> Int
trimmedLength = length . trim
試圖使用(.)
作爲函數組合,但它不起作用。在PureScript如何在PureScript中編寫函數?
import Data.String (length, trim)
trimmedLength :: String -> Int
trimmedLength = length . trim
功能組合物與(<<<)
,不(.)
完成。
import Data.String (length, trim)
trimmedLength :: String -> Int
trimmedLength = length <<< trim
這是冗長的。不是puresript支持unicode,因此可能有'?'? – ftor
是的,它只是沒有包含在覈心'Prelude'中。如果項目特定的前奏對象適合unicode友好的項目,通常會定義它。 –
就在幾分鐘前,還有一家圖書館(迄今爲止)只做這件事 - [purescript-gorgeous](https://github.com/slamdata/purescript-gorgeous) - 儘管它還沒有在追蹤中發佈。 – ahstro