Discussion:
[Texmacs-dev] plugin for Haskell
Bertrand Bratschi
2018-07-22 16:56:48 UTC
Permalink
Hi All,

I (almost completely) completed the realization of a plugin for Haskell.

You can see in the figures how it works.

If anyone is interested in this project, I would be happy to ask some
questions for improving some minors details.

Best greeting from India.
Bertrand
BB
2018-07-27 16:23:22 UTC
Permalink
Dear All,

For finishing properly the creation of a plugin for Haskell, I need to add the following modifications in a file named init-haskell.scm that I wrote by analogy on what I observed for some other Texmacs plugins (but without having a real understanding of how that works).
I want to modify (haskell-serialize lan t) by adding:

[1] : (string-replace s "\"" "''") "\n")

In order to substitute two simple quotes by on double quote.
With that the plugin can accept the definition of a string like
name = "blabla"

I also nees the following :

[2] : (string-replace s "\n" "~") "\n")

That is for interpreting multiline expressions, or some code with Haskell indentation.

When only [1] or [2] is introduced, that produces the expected result, but I don’t know how to get both of then.

For example if I try

(define (haskell-serialize lan t)
(with u (pre-serialize lan t)
(with s (texmacs->code (stree->tree u))
(string-append (string-replace s "\"" "''") "\n")
(string-append (string-replace s "\n" "~") "\n")
)))

, then in that case only the last replacement is implemented...

Greetings,
Bertrand

Loading...