¿Scala tiene un operador similar al 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
Con el fin de hacer que la pregunta sea independiente, sería bueno si explicaras lo que es/es la construcción de Haskell. –
$ es aparentemente correcto asociativo y tiene una baja precedencia http://learnyouahaskell.com/higher-order-functions#function-application. – huynhjl