Giter VIP home page Giter VIP logo

Comments (8)

kassio avatar kassio commented on May 30, 2024

Hello @alok, unfortunately, I know nothing of Haskell. There are some examples on the project's readme about how to add a new REPL. If possible, open a pull request and I'll be glad to merge it. 😄

from neoterm.

ararslan avatar ararslan commented on May 30, 2024

I don't know Haskell very well (read: at all) but I think simply adding this to ftdetect/set_repl_cmd.vim should do it:

" Haskell GHCi
au VimEnter,BufRead,BufNewFile *hs,
      \ if executable('ghci') |
      \   call neoterm#repl#set('ghci') |
      \ endif

I don't know whether GHCi's commands that begin with :, e.g. :def, will confuse Vim though. ¯_(ツ)_/¯

from neoterm.

alok avatar alok commented on May 30, 2024

That works decently well, though it can't do multiline commands or function declarations since GHCI requires those have the word "let" in front of them. I'm going to look at vim-slime for some inspiration.

from neoterm.

kassio avatar kassio commented on May 30, 2024

Why you can't use multiline commands an let functions with that solution?

from neoterm.

kassio avatar kassio commented on May 30, 2024

I'll close this for have no informations. But please, feel free it you can add more info.

from neoterm.

rattletat avatar rattletat commented on May 30, 2024

I'll close this for have no informations. But please, feel free it you can add more info.

I encountered that problem just now. Multi-line code in ghci must be fenced with :{ and :}. So, for example, if I visually select the lower 3 lines of the following code:

-- Compute the length of a list of Integers.
intListLength :: [Integer] -> Integer
intListLength []     = 0
intListLength (x:xs) = 1 + intListLength xs

it needs to be send to ghci in this way:

:{
intListLength :: [Integer] -> Integer
intListLength []     = 0
intListLength (x:xs) = 1 + intListLength xs
:}

from neoterm.

kassio avatar kassio commented on May 30, 2024

#274 introduced the possibility to have lang-specific REPL senders. Which would be helpful to solve this problem.

from neoterm.

kassio avatar kassio commented on May 30, 2024

I'll close this for have no informations. But please, feel free it you can add more info.

from neoterm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.