<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I had the same idea, here's my implemention, running on an old Winhugs
2001 (and GHC 6.8).<br>
regards,&nbsp; Daniel<br>
<br>
<br>
<tt>import System<br>
import Directory<br>
<br>
chars = map chr [32..126]<br>
<br>
string 0 = return ""<br>
string n = do<br>
&nbsp;c &lt;- chars<br>
&nbsp;s &lt;- string (n-1)<br>
&nbsp;return (c:s)<br>
<br>
mkfun n = do<br>
&nbsp;s &lt;- string n<br>
&nbsp;return ("f :: Integer -&gt; Bool; f = " ++ s)<br>
<br>
test fundef = do<br>
&nbsp;system ("del test.exe")<br>
&nbsp;writeFile "test.hs" (fundef ++ "; main = return ()")<br>
&nbsp;system ("ghc --make test.hs")<br>
&nbsp;b &lt;- doesFileExist "test.exe"<br>
&nbsp;if b then putStrLn fundef else return ()<br>
&nbsp;<br>
main = do<br>
&nbsp;let fundefs = [0..] &gt;&gt;= mkfun<br>
&nbsp;mapM_ test $ drop 1000 fundefs<br>
</tt><br>
Lennart Augustsson schrieb:
<blockquote
 cite="mid:f4876cd70902020956p34e4335aya976d95dbc867ed5@mail.gmail.com"
 type="cite">
  <pre wrap="">You can enumerate all possible implementations of functions of type
(Integer -&gt; Bool).
Just enumerate all strings, and give this to a Haskell compiler
f :: Integer -&gt; Bool
f = &lt;enumerated-string-goes-here&gt;
if the compiler is happy you have an implementation.

The enumerated functions do not include all mathematical functions of
type (Integer -&gt; Bool), but it does include the ones we usually mean
by the type (Integer -&gt; Bool) in Haskell.

  -- Lennart

On Mon, Feb 2, 2009 at 4:47 PM, Martijn van Steenbergen
<a class="moz-txt-link-rfc2396E" href="mailto:martijn@van.steenbergen.nl">&lt;martijn@van.steenbergen.nl&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Lennart Augustsson wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">The Haskell function space, A-&gt;B, is not uncountable.
There is only a countable number of Haskell functions you can write,
so how could there be more elements in the Haskell function space? :)
The explanation is that the Haskell function space is not the same as
the functions space in set theory.  Most importantly Haskell functions
have to be monotonic (in the domain theoretic sense), so that limits
the number of possible functions.
      </pre>
    </blockquote>
    <pre wrap="">I was thinking about a fixed function type A -&gt; B having uncountably many
*values* (i.e. implementations). Not about the number of function types of
the form A -&gt; B. Is that what you meant?

For example, fix the type to Integer -&gt; Bool. I can't enumeratate all
possible implementations of this function. Right?

Martijn.

    </pre>
  </blockquote>
  <pre wrap=""><!---->_______________________________________________
Haskell-Cafe mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a>

  </pre>
</blockquote>
</body>
</html>