Hi Haskellers, <div><br><div>I&#39;m wondering why, given that functions and referential transparency are first class citizens in haskell, it isn&#39;t possible to write a mapping function this way:</div></div><div><br></div>
<div>f1 :: a -&gt; b</div><div><br></div><div>f2 :: a -&gt; b</div><div><br></div><div>f3 :: c -&gt; a -&gt; b</div><div><br></div><div>map :: (a -&gt; b) -&gt; T a -&gt; T b</div><div>map f1 = anEquivalentOfF1InTCategory</div>
<div>map f2 = anEquivalentOfF2InTCategory</div><div>map f3 $ c = anEquivalentOfF3withCInTCategory</div><div>map unknown = aGenericMapInTCategory</div><div><br></div><div>Is it &quot;just&quot; the implementation complexity of the feature in ghc that prevents this? </div>
<div>Or is it &quot;conceptually&quot; wrong?</div><div><br></div><div>At a first look, I thought that most of complexity here should be related to function&#39;s equality, but than I thought that the function full name should uniquely map from the category of meanings in the programmer mind to the category of implementations available to the compiler&#39;s.</div>
<div><br></div><div><br></div><div>Giacomo</div>