knupfer / haskell-emacs

Write Emacs extensions in Haskell
376 stars 22 forks source link

Matrix.transpose producing something very unlike what Matrix.identity produces #66

Open JeffreyBenjaminBrown opened 7 years ago

JeffreyBenjaminBrown commented 7 years ago

Evaluating (Matrix.transpose ’((1 2 3) (4 5 6))) prints something weird to the message-buffer:

Takes a matrix (a list of lists of ints) and returns its transposition.
" (cons (quote progn) (cons (list (quote process-send-string) (quote haskell-emacs--proc) (list (quote format) "%S" (list (quote haskell-emacs--optimize-ast) (list (quote quote) (cons (quote Matrix\.transpose) (list x1)))))) (quote ((haskell-emacs--get 0)))))), 2

However, another function defined at .emacs.d/haskell-fun/Matrix.hs behaves like you might expect: (Matrix.identity 1) prints ((1)) in the message buffer.

I evaluated those expressions from within a buffer, using C-x C-e. I'm running GNU Emacs 26.0.50 in Ubuntu. I chose stack when prompted during installation of haskell-emacs.

JeffreyBenjaminBrown commented 7 years ago

It's even weirder than I thought.

(Matrix.transpose '((1 2)
            (3 4)
            (5 6)
            ))

prints a simple ((1 3 5) (2 4 6)) to the message buffer. However,

(Matrix.transpose ’((1 2 3)
            (4 5 6)
            ))

prints this instead:

macroexpand: Wrong number of arguments: (lambda (x1) "transpose :: [[Int]] -> [[Int]]

Takes a matrix (a list of lists of ints) and returns its transposition.
" (cons (quote progn) (cons (list (quote process-send-string) (quote haskell-emacs--proc) (list (quote format) "%S" (list (quote haskell-emacs--optimize-ast) (list (quote quote) (cons (quote Matrix\.transpose) (list x1)))))) (quote ((haskell-emacs--get 0)))))), 2
georgewsinger commented 7 years ago

@JeffreyBenjaminBrown : Out of curiosity, are you executing these functions with Emacs 25?

JeffreyBenjaminBrown commented 7 years ago

When I try to evaluate any of these commands now, I get a void-function error.

I've been running Emacs 26.0.50 (and the same OS -- my previous comment was in error) since I started this issue. Thinking it had gotten uninstalled somehow, I ran package-list-packages and found haskell-emacs-base on the list, so I asked to install it. I got messages like it was working but it never said it was done installing. Then I looked in haskell-fun and found files I had added to it before, as well as the things that installed initially (HaskellEmacs.hs, Matrix.hs, ...).