~jojo/Carth

ref: ae1d242d7d48292779dcbd953e5864bb4211e1ca Carth/src/Macro.hs -rw-r--r-- 4.7 KiB
Update stackage release & use default-extensions in cabal file

Also, fix some minor breakages caused by ghc update, fix the
literate.org example, fix some new warnings, and get rid of the need
for a bunch of Data implementations by using basic parsing functions
in SystemSpec.hs.
Add patterns & declaration of literals in macros

Example of a do-notation-like macro using the new features:

    (defmacro do (<-)
      (case (do-bind ma) ma)
      (case (do-bind (<- a ma) mbs ...)
            (do-bind (fun (a) (do do-bind mbs ...)) ma))
      (case (do-bind ma mbs ...)
            (do-bind (fun (_) (do do-bind mbs ...)) ma)))

which can be used like

    (do list/bind
        (<- i (list 1 2 3))
        (<- j (list 1 2 3))
        (if (< i j)
            (list/singleton [i j])
          list/nil))
Include macro expansion trace in SrcPos. Better err msgs!

    POS1: Error:
      CODE
    MESSAGE

    POS2: Note:
      CODE
    In expansion of macro.
Add macro rules and ellipsis (...) macro operator
Add primitive, single pattern macros

E.g. `(defmacro (plus a b) (+ a b))`