title: How do I make this F# Function properly return a boolean value while using a For In statement?
body: <p>Sorry if my title isn't descriptive enough, I wasn't sure how to phrase the problem...
  I'm used to programming in C# and have been dabbling in F#. I'm trying to write a function I use in some C# scripts that checks if the string is numeric. I have a F# function written up like this though its not correct according to VS because its expecting an else:</p>
  <pre><code>let IsNumeric (entry : string) : bool =     // Function to make sure the data entered is numeric
      for c : char in entry do
          if not ((c &gt;= '0') &amp;&amp; (c &lt;= '9')) then
              false
      true
  </code></pre>
  <p>If I put in an else statement and remove the true at the bottom:</p>
  <pre><code>let IsNumeric (entry : string) : bool =     // Function to make sure the data entered is numeric
      for c : char in entry do
          if not ((c &gt;= '0') &amp;&amp; (c &lt;= '9')) then
              false
          else true
  </code></pre>
  <p>I get this error</p>
  <blockquote>
  <p>FS0001    This expression was expected to have type 'bool' but here has type 'unit'</p>
  </blockquote>
  <p>... if I keep the true at the bottom like in the first code block I get a warning about it returning a bool but should be ignored which I don't quite understand.</p>
  <blockquote>
  <p>FS0020    The result of this expression has type 'bool' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |&gt; ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.</p>
  </blockquote>
  <p>This is the C# method I wrote that I've been trying to adapt:</p>
  <pre><code>public static bool IsNumeric(string s) //this just makes sure the string is numeric.
  {
      foreach (char c in s)
      {
          if (!(c &gt;= '0' &amp;&amp; c &lt;= '9') &amp;&amp; c != '.' &amp;&amp; c != '-')
          {
              return false;
          }
  
      }
      return true;
  }
  </code></pre>
  <p>How should I approach this?</p>