title: What does Cons and :-: mean in Haskell?
body: <p>In <a href="http://learnyouahaskell.com/" rel="noreferrer">LYAHFGG</a>, one chapter says that list is defined as:</p>
  
  <pre><code>data List a = Cons a (List a) deriving (Show, Read, Eq, Ord)
  </code></pre>
  
  <p>I understand what most of this means apart from Cons. When I try <code>:t Cons</code> and <code>:i Cons</code> in <code>ghci</code> I get a  not in scope error. Later on in the chapter it also talks about :-: and how it's the same as Cons</p>
  
  <pre><code>infixr 5 :-:  
  data List a = Empty | a :-: (List a) deriving (Show, Read, Eq, Ord)  
  </code></pre>
  
  <p>But again I really don't understand what this <code>:-:</code> means either. </p>
  
  <p>In another resource, in a section about data types, they define the following data type:</p>
  
  <pre><code>data Expr = X
        | Const Int
        | Expr :+: Expr
        | Expr :-: Expr
        | Expr :*: Expr
        | Expr :/: Expr
        | IfZero Expr Expr Expr
        deriving (Eq, Ord)
  </code></pre>
  
  <p>Where <code>IfZero p q r</code> is the same as <code>if p == 0 then q else r</code>. Is this the same thing? I'm mostly confused as to what the two <code>:</code>s mean, and if it's mandatory syntax or just style choice.</p>