What is a pipe point ?. operator in Haskell?

I understand "." (dot) as a function of composition. I understand "|" (pipe) as "or", the syntax for introducing protection (from here ), but I saw respond to http channels using ". |" that use this operator in a way that I do not understand.

Other piping links I found, for example:

... suggest syntax like "$$", "$ =", "= $ =", "= $" to join channels in data streams.

What should I call it ?. | this operator and how does it work?

As you might expect, searches for ". Haskell" or "dot pipe" haskell "or" dot pipe 'haskell operator conduits "were not very successful.

+6
source share
2 answers

This is just the new (new) syntax that conduit uses to merge. This was recently written by the author of blog-post . To quote the post, he suggested (and eventually did it) on

Replace the operators $= , =$ and =$= - all the synonyms of each other are different with the operator .| . This takes intuition from the Unix shell, where a pipe operator denotes piping data from one process to another. The analogy is really good for conduit, so why not take it? (We call all these operators "merging.")

Aside, if you ever need to look for operators, Hayoo and Hoogle are the places to go. There is also a Stackage Hoogle (thanks @duplode) which allows you to search for operators for specific resolvers (which is especially useful here since this is a recent change).

+9
source

.| introduced by the Conduit library and is synonymous with fuse .

 fuse :: Monad m => Conduit amb -> ConduitM bcmr -> ConduitM acmr 

fuse used to conduit in the same way as a statement . used to compose functions. Finally,. .| is the new syntax for replacing $= , =$ and =$= , which were synonyms anyway.

+1
source

Source: https://habr.com/ru/post/1012864/


All Articles