The Purescript book is great. However, I am finding there isn’t a comprehensive guide to the syntax of the entire language. Something like that in the book would be useful. Even an ABNF
description of the syntax would serve as a guide to new users once there appetite was wetted.
Additionally, I recently skipped ahead to, “Monodic Adventures: The State Monad”, which introduced a new state monad, State s
, in a way oblivious of the previously introduced state monad, ST
. As I write this I am suspecting I may have missed some sentence explaining that, type ST = State s
for some constrained s
. Actually, this terseness in the book is also an issue…it should be more of a conversation. I’ll ignore the fact that the State
should have been named, StateConstructor
per its function.
One of the things I like about F#
is that the core syntax is modeled as function application. However, F# does not have type classes and higher kinds which perhaps permits such syntactic simplicity. However, I wonder whether much of the syntax for defining structures in Purescript can ultimately be of a more consistent simplified form. For example:
thing IDENTIFIER PARM_1 ... PARM_N of CONSTRAINT_1, ..., CONSTRAINT_M where DEFINITION
Here, thing
is one of keywords type, newtype, data, class, instance, let
. Of course, this may drift Purescript too substantially away from the older Haskell syntax (or that may already be the case but I don’t yet know it).
Finally, forall
seems like a thing that should be implicit. However, there does seem to be a need to distinquish these free type variable names from other identifiers that may become bound within the module. Unfortunately, the only thing I can think of would be to augment such names, such as by suffixing them with $
for instance, but this also seems like an inferior solution to forall
.
My $0.02