@@ -71,7 +71,11 @@ which =haskell-emacs= cannot marshal to the correct type. Please keep in
71
71
mind that Emacs Lisp Arrays will be translated (recursively) to
72
72
Haskell Lists and Emacs Lisp Lists will be marshaled to either Haskell
73
73
Lists or Haskell Tuples.
74
-
74
+ * Build tools
75
+ You can use your favorite build tool. Nix, stack and cabal are
76
+ supported out of the box. If you don't specify which one to use via
77
+ =haskell-emacs-build-tool= it'll try to guess your build tool and ask
78
+ you when initializing.
75
79
* Performance
76
80
There is a (very) small overhead calling Haskell functions, so for very
77
81
trivial situations, elisp functions will be faster. On my laptop
@@ -421,64 +425,6 @@ has to transfer the whole buffer.
421
425
Note that in such a trivial case a function written in elisp would be
422
426
faster (albeit a lot unsafer). A sophisticated function could take
423
427
the buffer-string, parMap it and replace the old buffer-string.
424
- * Modules
425
- If you want to distribute a Haskell library for =haskell-emacs=,
426
- just write an elisp file describing the package and the
427
- corresponding Haskell file in the same dir:
428
- #+BEGIN_SRC elisp
429
- ;;;; haskell-emacs-pi/haskell-emacs-pi.el
430
-
431
- ;;; haskell-emacs-pi.el --- return pi
432
-
433
- ;; Version: 1.0.0
434
- ;; Package-Requires: ((haskell-emacs "2.4.0"))
435
-
436
- ;;; Code:
437
-
438
- (require 'haskell-emacs)
439
- (provide 'haskell-emacs-pi)
440
-
441
- ;;; haskell-emacs-pi.el ends here
442
- #+END_SRC
443
-
444
- #+BEGIN_SRC haskell
445
- ---- haskell-emacs-pi/Pi.hs
446
-
447
- module Pi (piSquare) where
448
-
449
- piSquare :: Double
450
- piSquare = pi^2
451
- #+END_SRC
452
-
453
- That's all. You can distribute this package for example via
454
- melpa (don't forget to add the *.hs to the files of the recipe)
455
- or just point your =load-path= to this directory. If you call
456
- afterwards =haskell-emacs-init=, it will automatically find this
457
- module and provide the functions.
458
-
459
- If you want to use such functions in your elisp library, do the following:
460
-
461
- #+BEGIN_SRC elisp
462
- ;;; my-nums.el --- add a number to the square of pi
463
-
464
- ;; Package-Requires: ((haskell-emacs-pi "1.0.0"))
465
-
466
- ;;; Code:
467
-
468
- (require 'haskell-emacs-pi)
469
- (eval-when-compile (haskell-emacs-init))
470
-
471
- ;;;### autoload
472
- (defun my-nums (arg)
473
- (+ arg (Pi.piSquare)))
474
-
475
- ;;; my-nums.el ends here
476
- #+END_SRC
477
- * Nixos
478
- The integration with NixOS is handled by compiling in a =nix-shell=
479
- which is customizeable. You can for example add the --pure flag and
480
- list all the dependencies. Obviously, in this case, a cabal sandbox
481
- wouldn't make sense.
482
428
* Shortcomings
483
429
Not all types marshal across languages, if you write a function with
484
430
an unknown type, =haskell-emacs-init= will signal an error with the
0 commit comments