{"action":"created","issue":{"url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/28","labels_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/28/comments","events_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/28/events","html_url":"https://github.com/Gabriel439/Haskell-Turtle-Library/issues/28","id":57985367,"number":28,"title":"Syntactic sugar for piping, redirection","user":{"login":"FranklinChen","id":134491,"avatar_url":"https://avatars.githubusercontent.com/u/134491?v=3","gravatar_id":"","url":"https://api.github.com/users/FranklinChen","html_url":"https://github.com/FranklinChen","followers_url":"https://api.github.com/users/FranklinChen/followers","following_url":"https://api.github.com/users/FranklinChen/following{/other_user}","gists_url":"https://api.github.com/users/FranklinChen/gists{/gist_id}","starred_url":"https://api.github.com/users/FranklinChen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FranklinChen/subscriptions","organizations_url":"https://api.github.com/users/FranklinChen/orgs","repos_url":"https://api.github.com/users/FranklinChen/repos","events_url":"https://api.github.com/users/FranklinChen/events{/privacy}","received_events_url":"https://api.github.com/users/FranklinChen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-17T21:31:43Z","updated_at":"2015-02-25T19:42:13Z","closed_at":null,"body":"I know this is part of a much larger topic of syntax, but I am a fan of the reverse function application \"pipe\" operator extremely popular these days, in the OCaml and Elixir and Clojure communities, for example. I personally define it for myself in Haskell as\r\n\r\n```haskell\r\ninfixl 0 |>\r\n(|>) :: a -> (a -> b) -> b\r\nx |> f = f x\r\n```\r\nUsing this syntax, some things in Turtle look much more accessible:\r\n\r\n```haskell\r\ninshell \"ls\" empty |> stdout\r\n\r\nstdin |> stdout\r\n\r\n(\"Test\" <|> \"ABC\" <|> \"42\") |> output \"file.txt\"\r\n\r\ninput \"file.txt\" |> stdout\r\n\r\ninput \"file.txt\" |> grep \"ABC\" |> stdout\r\n```\r\n\r\nAny interest in promoting this syntax? I believe it would be a huge win for those coming from Unix and basically anyone coming from an OO \"topic-comment\" or \"noun-verb\" way of thinking."},"comment":{"url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/comments/76039619","html_url":"https://github.com/Gabriel439/Haskell-Turtle-Library/issues/28#issuecomment-76039619","issue_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/28","id":76039619,"user":{"login":"michaelt","id":217793,"avatar_url":"https://avatars.githubusercontent.com/u/217793?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelt","html_url":"https://github.com/michaelt","followers_url":"https://api.github.com/users/michaelt/followers","following_url":"https://api.github.com/users/michaelt/following{/other_user}","gists_url":"https://api.github.com/users/michaelt/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelt/subscriptions","organizations_url":"https://api.github.com/users/michaelt/orgs","repos_url":"https://api.github.com/users/michaelt/repos","events_url":"https://api.github.com/users/michaelt/events{/privacy}","received_events_url":"https://api.github.com/users/michaelt/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T19:42:12Z","updated_at":"2015-02-25T19:42:12Z","body":"I agree the F# `|>` would have better suited this library (it also fits with `>>>` composition nicely, if I remember the usual arguments); but `&` proved a winner in the lens libraries, I think not without reason.  It certainly beats `$`.   But one is going to have to get used to new things with this or any library -- I just made my second attempt comprehending it last night. So the main question you raise is whether the order aids comprehension, and the sign would be worth exporting and maybe throwing around in the tutorial a bit. In fact, I was finding it pleasantly readable, especially if I added space around it to make a bit of caesura\r\n\r\n       input \"a.txt\" <|> input \"b.txt\"  &  grep (has \"4\")  &  sed exclaim  &  output \"c.txt\"\r\n\r\n(Pardon arbitrary expression.)  Obviously unix symbol associations aren't going to help here, but the associated image of 'flow' was seeming not too bad.  One might want, e.g. a flipped `fold` for this style.\r\n\r\n\r\n"}}