[Haskell-cafe] Hdevtools cabal support
Maxim Kulkin
maxim.kulkin at gmail.com
Fri Feb 21 11:29:01 UTC 2014
Oh, thank you, Sir, for pointing that out.
I was aware of this hackish vim-script. I even tried to use that but fell
into lots of corner cases and dropped. It does not handle inter-package
dependencies, haskell language extensions, different code or sandbox layout.
Although currently it has limitations (locked to particular ghc and cabal
versions) I personally find it way more easy to use.
I believe, with release of GHC-7.8, Cabal-1.18 will become ubiquitous,
bringing sandbox support out of the box. With evolving of the compiler I do
not see why dev tools shouldn't evolve too. If someone uses cabal-dev, I
would happy to see him adding support for it to hdevtools. BTW, cabal-dev
just changes the sandbox layout, other things are left unchanged, so you
can still benefit from having cabal support in hdevtools. You just need to
pass location of cabal-dev sandboxed package db explicitly (via "-g"
option).
On Fri, Feb 21, 2014 at 2:11 PM, Daniel Trstenjak <
daniel.trstenjak at gmail.com> wrote:
>
> Hi Maxim,
>
> > I'm pretty new to Haskell, but was doing Haskell development for
> > several month. I'm fan of Vim editor and was happy to find out that
> > there are good tools to support Haskell development with Vim, e.g.
> > vim-hdevtools. But it turned out that it not of much use in my project
> > where we rely on Cabal packages and sandboxes.
>
> You don't need to modify hdevtools to get support for cabal sandboxes.
> But you have to tell hdevtools the position of the package database of
> the cabal sandbox.
>
>
> For vim you could use something like:
>
> function! s:FindCabalSandbox()
> let l:sandbox = finddir('.cabal-sandbox', './;')
> let l:absSandbox = fnamemodify(l:sandbox, ':p')
> return l:absSandbox
> endfunction
>
> function! s:FindCabalSandboxPackageConf()
> return glob(s:FindCabalSandbox() . '*-packages.conf.d')
> endfunction
>
> function! s:HaskellSourceDir()
> return fnamemodify(s:FindCabalSandbox(), ':h:h') . '/src'
> endfunction
>
> let g:hdevtools_options = '-g-package-conf=' .
> s:FindCabalSandboxPackageConf()
> let g:hdevtools_options .= ' ' . '-g-i' . s:HaskellSourceDir()
>
>
> This also assumes, that your Haskell source code is contained in a
> directory named 'src' which lies in the same directory then your
> projects cabal file.
>
>
> Using hdevtools this way is more generic than modify it, because this
> solution also works for cabal-dev or any other package database.
>
>
> Greetings,
> Daniel
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140221/a4d28720/attachment.html>
More information about the Haskell-Cafe
mailing list