riju/langs/haskell.yaml

75 lines
1.4 KiB
YAML

id: "haskell"
aliases:
- "ghc"
- "ghci"
- "hs"
name: "Haskell"
install:
prepare:
apt:
- cabal-install
manual: |
cabal update
apt:
- ghc
manual: |
install -d "${pkg}/usr/local/bin"
install -d "${pkg}/opt/brittany"
cabal install brittany --installdir "$PWD"
cp -L brittany "${pkg}/usr/local/bin/"
mkdir haskell-language-server
pushd haskell-language-server
ver="$(latest_release haskell/haskell-language-server)"
release="$(curl -fsSL "https://api.github.com/repos/haskell/haskell-language-server/releases/tags/${ver}")"
echo "${release}" | jq '.assets[].name' -r | grep Linux | grep -vF .tar | while read asset; do
wget "https://github.com/haskell/haskell-language-server/releases/download/${ver}/${asset}"
gunzip "${asset}"
done
chmod +x *
for binary in *; do
cp -T "${binary}" "${pkg}/usr/local/bin/${binary//-Linux/}"
done
popd
repl: |
rm -f .ghci
ghci
main: "Main.hs"
template: |
module Main where
main :: IO ()
main = putStrLn "Hello, world!"
run: |
(echo ':load Main' && echo 'main') > .ghci && ghci
scope:
code: |
x = 123 * 234
format:
run: |
brittany
input: |
module Main where
main :: IO ()
main =
putStrLn "Hello, world!"
lsp:
start: |
haskell-language-server-wrapper --lsp
init:
languageServerHaskell: {}
code: "TODO"
item: "TODO"
skip:
- lsp