Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think that there is most certainly a solid point in this question. It is illuminated by looking into how any library might handle <strong>exceptions</strong>. </p> <p>If you interact with a Java library, any method may throw an exception. This could be either explicitly, via a <em>checked</em> exception - or transparently (from an API perspective), via a <em>runtime</em> exception. What are you supposed to do about this, as a programmer who might be trying to use the more functional <code>Either</code> type to indicate failure (or <strong>scalaz</strong>'s <code>Validation</code>)?</p> <p>It's not at all clear to me how this will play out in scala (i.e. approaching the problem and choosing the purely functional approach). Certainly it is likely to produce <strong>many different styles</strong> of coding. That said, there is much that is rich and useful along the functional side of scala which you can pick from; and it is certainly possible to have this mix of functional and imperative code in your program work alongside each other. Although a functional <em>purist</em> may of course disagree about whether this an optimal situation.</p> <p>For what it's worth, I've found that the application of functional paradigms within my programs has improved my code no end. As I haven't tried either <strong>Haskell</strong> or <strong>F#</strong> I couldn't tell you whether the net result is better or worse.</p> <p>But it wipes the floor with Java; and to get that <em>on the JVM</em> (with the practical advantage of coexisting with all our Java libraries) is a killer app, from my perspective.</p> <hr/> <p>At the edges, as you begin to use scala's functional side more, there are a number of issues which you will run into. These are most obviously:</p> <ul> <li>the lack of implicit function <em>currying</em> (i.e. equivalence of <code>A =&gt; B =&gt; C</code> and <code>(A, B) =&gt; C</code>)</li> <li>the lack of implicit function <em>tupling</em> (i.e. equivalence between an n-ary function and a 1-ary function which takes an n-tuple as a parameter)</li> <li>the lack of inference for partially-applied type constructors (i.e. the equivalence of <code>M[A]</code> with, for example, <code>Either[Int, A]</code>)</li> </ul> <p>Both of these issues make what should be pretty and clear functional code, ugly and obscure.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload