Why Purescript?

Indeed, Purescript is basically Haskell with cruft removed and focused for the web, unlike GHCJS, which transpiles Haskell directly to Javascript. It uses HKT’s instead of HPT’s, which are more convenient (no +/+. distinction for example), but is not as capable of as many things and compiles significantly slower. It is a well designed language, just not my style. ^.^

That is because OCaml uses HPT instead of HKT, which means it is more powerful, however it does necessitate things like that. However, OCaml has a feature coming in 4.05/4.06 called Implicit Modules, it adds a single feature that uses HPT’s to create static lookups based on type in the current scope. It is not whole program like HKT’s are, but it does not compromise the instant-compile-time. You have to decorate your implicit functions with a new argument (implicit), which will generally only be done by library authors, not you, however it means that you could then write (and include over the Kernel’s version of) a new + that can handle any type.

However, things like + and +. are not a big deal, you already know the types that you are dealing with and the compiler tells you if you screw up anywhere. :wink:

I’d definitely be interested in you making a ‘Why Purescript?’ post though! I’m curious what I’ve missed about it that might make it interesting to me (Haskell’y systems, I.E. HKT’s hold little to no appeal for me over HPT’s; HPT’s do more and do not have the monstrous compile-time hit). :slight_smile:

2 Likes