Haskell: How do you figure out the definition of <*> from a Monad definition?
<p>I have a parser object defined:</p>

<pre><code>newtype Parser a = Parser (String -&gt; [(String, a)])
</code></pre>

<p>And a function to produce them:</p>

<pre><code>produce :: a -&gt; Parser a
produce x = Parser (\ts -&gt; [(ts, x)])
</code></pre>

<p>And an instance of Monad for this parser object to allow me to bind multiple parsers into one:</p>

<pre><code>instance Monad Parser where
  return = produce
  Parser px &gt;&gt;= f = Parser (\ts -&gt;
   concat([parse (f x) ts' | (ts', x) &lt;- px ts]))
</code></pre>

<p>I have also been using &lt;*> quite happily to chain multiple parsers for different types to parse a string with different parts within it.</p>

<p>Of course &lt;*> is defined via the following:</p>

<pre><code>(&lt;*&gt;) = ap
</code></pre>

<p>But I want to define it explicitly so that I am able to understand and explain how it works exactly and I have been unable to figure it out.</p>

<p>So how can I figure out how to explicitlly find the definition of ap or &lt;*> in this instance?</p>

<p>Any advice on what &lt;*> would be or how I should work it out is appreciated.</p>

<p>Thanks.</p>