Name: Anonymous 2015-04-02 22:10
Higher-kinded type classes is what makes Haskell stand out above other functional languages for me. Things like endofunctors just cannot exist in virtually any other language.
def bbCodeB(in: String): String = rBold.replaceAllIn(in, (m: Match) => "<b>" + (m group "c") + "</b>")
def bbCodeUrl(in: String): String = rLink.replaceAllIn(in, (m: Match) => "<a href=\"" + (m group "add") + "\">" + (m group "c") + "</a>")
def bbCodeC(in: String): String = rCode.replaceAllIn(in, (m: Match) => "<pre>" + (m group "c") + "</pre>")
def bbCodeS(in: String): String = rStrike.replaceAllIn(in, (m: Match) => "<span class=\"s\">" + (m group "c") + "</span>")
def bbCodeSp(color: String, in: String): String = rSpoiler.replaceAllIn(in, (m: Match) => """<span class="sp"
onmouseover="this.style.color=#000000;" onmouseout="this.style.color=""" + color + """;">""" + (m group "c") + "</span>")
def bbCodeU(in: String): String = rUnderline.replaceAllIn(in, (m: Match) => "<span class=\"un\">" + (m group "c") + "</span>")
def bbCodeI(in: String): String = rItalic.replaceAllIn(in, (m: Match) => "<i>" + (m group "c") + "</i>")
def bbCodeNl(in: String): String = rNewline.replaceAllIn(in, "<br />")
def apply_bbCodes(color: String, inp: String): String = (
bbCodeUrl _ compose
bbCodeB _ compose
bbCodeI _ compose
bbCodeC _ compose
(bbCodeSp(color, _: String)) compose
bbCodeU _ compose
bbCodeS _ compose
bbCodeNl
)(rGT.replaceAllIn(rLT.replaceAllIn(inp, "<"), ">"))
not in haskell/Lisp
immutable dataSo to replace all 'a's 'b's and 'c's you need to malloc 3 strings?
referentially transparent functionspass-by-reference is immensely useful,pass-by-value is introducing copies and extra variables.
So to replace all 'a's 'b's and 'c's you need to malloc 3 strings?No. The three traversals may be easily fused into one.
pass-by-value is introducing copies and extra variables.In Haskell all functions are pass-by-reference because with immutability you don't need anything else.
using globals and global state is the most efficient way.The most efficient way to create undebuggable spaghetti with errors constantly springing up out of nowhere? Yes.
All thats useful and practical in haskell is already done better by [...] OOP languages.IHBT
and mutable updates will go the way of the dinosaur.People said same things about GOTO.