Skip to content

Commit 7bdd47e

Browse files
authored
Add xeus-haskell kernel to conformance tests (#39)
Seventh (and final) of 7 xeus kernels requested in #30. Adds Haskell language snippets. Key changes: - Build xeus-haskell from source using Pixi (not yet on conda-forge) - Add 15-minute timeout for build-from-source jobs Note: xeus-octave (PR #36) uses Xvfb for X11 requirements.
1 parent 4f70068 commit 7bdd47e

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

.github/workflows/conformance.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
test-kernel:
1515
name: Test ${{ matrix.kernel.name }}
1616
runs-on: ubuntu-latest
17-
timeout-minutes: 10
17+
timeout-minutes: 15
1818
strategy:
1919
fail-fast: false
2020
matrix:
@@ -86,6 +86,16 @@ jobs:
8686
- name: xeus-lua
8787
install: micromamba install -y xeus-lua -c conda-forge
8888
kernel-name: xlua
89+
- name: xeus-haskell
90+
install: |
91+
curl -fsSL https://pixi.sh/install.sh | bash
92+
export PATH="$HOME/.pixi/bin:$PATH"
93+
git clone https://github.com/jupyter-xeus/xeus-haskell /tmp/xeus-haskell
94+
cd /tmp/xeus-haskell
95+
pixi run -e default prebuild
96+
pixi run -e default build
97+
pixi run -e default install
98+
kernel-name: xhaskell
8999

90100
steps:
91101
- uses: actions/checkout@v4

src/snippets.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ impl LanguageSnippets {
5353
"c++" | "cpp" => Self::cpp(),
5454
"sql" => Self::sql(),
5555
"lua" => Self::lua(),
56+
"haskell" => Self::haskell(),
5657
_ => Self::generic(&lang),
5758
}
5859
}
@@ -292,6 +293,27 @@ xcpp::display(h);"#,
292293
}
293294
}
294295

296+
fn haskell() -> Self {
297+
// Haskell functional language
298+
Self {
299+
language: "haskell".to_string(),
300+
print_hello: "putStrLn \"hello\"",
301+
print_stderr: "import System.IO; hPutStrLn stderr \"error\"",
302+
simple_expr: "1 + 1",
303+
simple_expr_result: "2",
304+
incomplete_code: "let x =",
305+
complete_code: "let x = 1",
306+
syntax_error: "let let",
307+
input_prompt: "-- Haskell stdin varies by kernel",
308+
sleep_code: "import Control.Concurrent; threadDelay 2000000",
309+
completion_var: "testVariableForCompletion",
310+
completion_setup: "let testVariableForCompletion = 42",
311+
completion_prefix: "testVariableFor",
312+
display_data_code: "putStrLn \"no rich display\"",
313+
update_display_data_code: "-- Haskell doesn't support update_display_data",
314+
}
315+
}
316+
295317
/// Generic fallback for unknown languages
296318
fn generic(language: &str) -> Self {
297319
Self {

0 commit comments

Comments
 (0)