Minor nitpick. Technically, this:
#(->> % (drop 3) (filter p) (take 5))
Is equivalent to: take 5 . filter p . drop 3 #(->> % (drop 3) (filter p) (take 5))
Is equivalent to: take 5 . filter p . drop 3 -- the pipe operator seems to be all the rage these days
(|>) = (&)
-- forward application + forward composition
xs |> (drop 3 >>> filter p >>> take 5)
Only function application xs |> drop 3 |> filter p |> take 5I do like the fact that the `pipe operator` is often mentioned along the bash '|' which is used in a pointfree style.
Well it might make sense sometimes, so its good to know one's options :)
p x y z = f (g x y) z
p = ((.) f) . g take 5 . filter p . drop 3
An anonymous function call in Haskell? I don't know the language (although it's on my to-learn sequence). \xs -> take 5 (filter p (drop 3 xs))
https://wiki.haskell.org/PointfreeOne of the types, for example:
take :: Int -> [a] -> [a]
What means a function that takes an Int argument and returns another function, that takes a list and returns a list of the same type.
phil@arod:~$ ghci
GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :t take 5 . filter (\ _ -> True) . drop 3
take 5 . filter (\ _ -> True) . drop 3 :: [a] -> [a]
So it’s a function from List of a to List of a