
http://www.haskell.org/haskellwiki/Typeclassopedia under §8.1, sconcat = sconcat (a :| as) = go a as where What is the meaning of :| ? I see it is really in the cited module source, not a typo on the page. More generally, is there some effective way to search for non-alphabetical Haskell things? Google just ignores the "punctuation".

It is the constructor for a non-empty list (Data.List.NonEmpty).
http://hackage.haskell.org/package/semigroups-0.12.2/docs/Data-List-NonEmpty...
On Fri, Mar 28, 2014 at 3:54 PM, John M. Dlugosz
http://www.haskell.org/haskellwiki/Typeclassopedia under §8.1,
sconcat = sconcat (a :| as) = go a as where
What is the meaning of :| ? I see it is really in the cited module source, not a typo on the page.
More generally, is there some effective way to search for non-alphabetical Haskell things? Google just ignores the "punctuation".
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On 3/28/2014 1:41 AM, Tony Morris wrote:
It is the constructor for a non-empty list (Data.List.NonEmpty).
http://hackage.haskell.org/package/semigroups-0.12.2/docs/Data-List-NonEmpty...
Interesting— this is the page I had found: http://www.haskell.org/haskellwiki/Non-empty_list So why do we need both :| and <| (or cons) ?

On Fri, Mar 28, 2014 at 01:58:11AM -0500, John M. Dlugosz wrote:
On 3/28/2014 1:41 AM, Tony Morris wrote:
It is the constructor for a non-empty list (Data.List.NonEmpty).
http://hackage.haskell.org/package/semigroups-0.12.2/docs/Data-List-NonEmpty...
Interesting— this is the page I had found: http://www.haskell.org/haskellwiki/Non-empty_list
So why do we need both :| and <| (or cons) ?
Look at the definitions and type signatures: (<|) :: a -> NonEmpty a -> NonEmpty a a <| ~(b :| bs) = a :| b : bs (:|) :: a -> [a] -> NonEmpty a data NonEmpty a = a :| [a] (I found the type-sig for (:|) using ghci ":t"). It is now evident that the constructor (:|) takes element/list to build |NonEmpty a|, while (<|) appends an |a| to a |NonEmpty a|.

On Fri, Mar 28, 2014 at 12:54:03AM -0500, John M. Dlugosz wrote:
More generally, is there some effective way to search for non-alphabetical Haskell things? Google just ignores the "punctuation".
You can find :| on Hayoo [1], the other handy place where to look for APIs stuff being Hoogle [2] (Hoogle is more focused on 'standard' Haskell libraries, Hayoo searches in all Hackage, both have their usefulness).
From there, if I need to search, say, a blog post, I will refer to the name of the typeclass/module/data and feed it to a search engine (so in this case "data NonEmpty etc. etc."). Apparently Google ignores punctuation in most cases [3].
Back to the original question
What is the meaning of :| ?
Clicking on the first occurrence in Hoogle brings me to Data.List.NonEmpty, where the specific operator is listed as the lone constructor of |data NonEmpty|. If the conspicuous name were not enough, checking the code: data NonEmpty a = a :| [a] we can see this looks like a list without the empty-list constructor. Does that answer your question? [1] http://holumbus.fh-wedel.de/hayoo/hayoo.html#0:%3A| [2] http://www.haskell.org/hoogle/ [3] https://support.google.com/websearch/answer/2466433 [4] http://hackage.haskell.org/package/semigroups-0.12.2/docs/Data-List-NonEmpty...

On Fri, Mar 28, 2014 at 2:48 AM, Francesco Ariis
On Fri, Mar 28, 2014 at 12:54:03AM -0500, John M. Dlugosz wrote:
More generally, is there some effective way to search for non-alphabetical Haskell things? Google just ignores the "punctuation".
You can find :| on Hayoo [1], the other handy place where to look for APIs stuff being Hoogle [2] (Hoogle is more focused on 'standard' Haskell libraries, Hayoo searches in all Hackage, both have their usefulness). From there, if I need to search, say, a blog post, I will refer to the name of the typeclass/module/data and feed it to a search engine (so in this case "data NonEmpty etc. etc."). Apparently Google ignores punctuation in most cases [3].
http://symbolhound.com is useful. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On Thu, Mar 27, 2014, at 10:54 PM, John M. Dlugosz wrote:
More generally, is there some effective way to search for non-alphabetical Haskell things? Google just ignores the "punctuation".
For that, you can use Hayoo. http://holumbus.fh-wedel.de/hayoo/hayoo.html -Karl

On 3/28/2014 1:48 AM, Karl Voelker wrote:
On Thu, Mar 27, 2014, at 10:54 PM, John M. Dlugosz wrote:
More generally, is there some effective way to search for non-alphabetical Haskell things? Google just ignores the "punctuation".
For that, you can use Hayoo.
http://holumbus.fh-wedel.de/hayoo/hayoo.html
-Karl
Awesome! Thanks for pointing that out.
participants (5)
-
Brandon Allbery
-
Francesco Ariis
-
John M. Dlugosz
-
Karl Voelker
-
Tony Morris