What are the primary theoretical difficulties with adding ML-style modules to Haskell?

The main place to do the comparison is, ML Modules and Haskell Type Classes: A Constructive Comparison. Stefan Wehr and Manuel M.T. Chakravarty. In Proceedings of The Sixth ASIAN Symposium on Programming Languages and Systems – APLAS 2008, Springer-Verlag, LNCS, 2008. Modular Type Classes. Derek Dreyer, Robert Harper, and Manuel M. T. Chakravarty. In Proceedings … Read more

What is the benefit of purely functional data structure?

Purely functional (aka persistent or immutable) data structures give you several advantages: you never have to lock them, which extremely improves concurrency. they can share structure, which reduces memory usage. For example, consider list [1, 2, 3, 4] in Haskell and some imperative language like Java. To produce new list in Haskell you only have … Read more

What is the preferred way to structure and build OCaml projects?

You’ve got a thorough listing of the options available, but this question will not have a clear answer. My personal recommendation is also to use ocamlbuild. The myocamlbuild.ml file provided here is a good start. It will allow you to easily compile projects that depend on various libraries. I don’t think it handles the case … Read more

Does != have meaning in OCaml?

you have experienced the difference between structural and physical equality. <> is to = (structural equality) as != is to == (physical equality) “odg” = “odg” (* true *) “odg” == “odg” (* false *) is false because each is instantiated in different memory locations, doing: let v = “odg” v == v (* true … Read more

Explaining pattern matching vs switch

Having formerly been one of “those people”, I don’t know that there’s a succinct way to sum up why pattern-matching is such tasty goodness. It’s experiential. Back when I had just glanced at pattern-matching and thought it was a glorified switch statement, I think that I didn’t have experience programming with algebraic data types (tuples … Read more

Why is writing a compiler in a functional language easier? [closed]

Often times a compiler works a lot with trees. The source code is parsed into a syntax tree. That tree might then be transformed into another tree with type annotations to perform type checking. Now you might convert that tree into a tree only containing core language elements (converting syntactic sugar-like notations into an unsugared … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)