I'm playing around with Haskell, but I can't figure out why the reverse function application operator (&) is not working.
For example in ghci I get:
Prelude> "hello" & length
<interactive>:1:9: error:
Variable not in scope: (&) :: [Char] -> ([a0] -> Int) -> t
When I expect it to return 5
Why is it not working?
Looks like it's not in scope. Asking Hoogle tells me that you need to import it from, for example, Data.Function:
Prelude> import Data.Function
Prelude Data.Function> "hello" & length
5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With