Scala có một nhà điều hành tương tự như Haskell's $
?
-- | Application operator. This operator is redundant, since ordinary
-- application @(f x)@ means the same as @(f '$' x)@. However, '$' has
-- low, right-associative binding precedence, so it sometimes allows
-- parentheses to be omitted; for example:
--
-- > f $ g $ h x = f (g (h x))
--
-- It is also useful in higher-order situations, such as @'map' ('$' 0) [email protected],
-- or @'Data.List.zipWith' ('$') fs [email protected]
{-# INLINE ($) #-}
($) :: (a -> b) -> a -> b
f $ x = f x
Để làm cho câu hỏi đứng một mình, nó sẽ là tốt đẹp nếu bạn giải thích những gì mà Haskell xây dựng là/không. –
$ dường như là hợp pháp và có ưu tiên thấp http://learnyouahaskell.com/higher-order-functions#function-application. – huynhjl