<div>Source: <a href="https://github.com/mcandre/genetics">https://github.com/mcandre/genetics</a></div><div><br></div><div>With <font class="Apple-style-span" face="'courier new', monospace">{-# LANGUAGE TypeSynonymInstances #-}</font> , my genetic algorithm code compiles and runs perfectly.<br clear="all">
<div><br></div><div><font class="Apple-style-span" face="'courier new', monospace">$ make</font></div><div><font class="Apple-style-span" face="'courier new', monospace">$ ./helloga</font></div><div><font class="Apple-style-span" face="'courier new', monospace">...</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">hellowobld</font></div><div><font class="Apple-style-span" face="'courier new', monospace">helloworyd</font></div><div><font class="Apple-style-span" face="'courier new', monospace">helloporld</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">hellyworld</font></div><div><font class="Apple-style-span" face="'courier new', monospace">helloworrd</font></div><div><font class="Apple-style-span" face="'courier new', monospace">hellowofld</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">hellpworld</font></div><div><font class="Apple-style-span" face="'courier new', monospace">Best candidate: helloworld</font></div><div><br>
</div><div>Without it, Haskell refuses to declare an instance on Strings.</div><div><br></div><div><font class="Apple-style-span" face="'courier new', monospace">$ make</font></div><div><font class="Apple-style-span" face="'courier new', monospace">ghc --make -O2 -fforce-recomp helloga.hs</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">[1 of 2] Compiling Genetics ( Genetics.hs, Genetics.o )</font></div><div><font class="Apple-style-span" face="'courier new', monospace">[2 of 2] Compiling Main ( helloga.hs, helloga.o )</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">helloga.hs:27:10:</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> Illegal instance declaration for `Gene String'</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> (All instance types must be of the form (T t1 ... tn)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> where T is not a synonym.</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> Use -XTypeSynonymInstances if you want to disable this.)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> In the instance declaration for `Gene String'</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">make: *** [all] Error 1</font></div><div><br></div><div>The fix is easy to discover and apply, but this is my first typeclass, nothing complicated. As a newbie I prefer that it "just works" without my having to use the special compile flag.</div>
<div><br></div>Cheers,<div><br></div><div>Andrew Pennebaker</div><div><a href="http://www.yellosoft.us" target="_blank">www.yellosoft.us</a></div><br>
</div>