Dhall Repl: strange formatting issues (Powershell on Windows 10 64bit)

86 Views Asked by At

When I'm working with dhall repl in Powershell I get a lot of weird output / encoding issues. I'm using the precompiled binaries for windows from https://github.com/dhall-lang/dhall-haskell/releases.

An example:

Welcome to the Dhall v1.40.1 REPL! Type :help for more information.
|- let makeSnippet = ./makeSnippet.dhall in makeSnippet "" []

Ôå│ ./makeSnippet.dhall
  Ôå│ ./Snippet.dhall

Error: Invalid type for ÔØ░ListÔØ▒

2Ôöé          [Text]

C:\xxx\Snippet.dhall:2:10

1Ôöé               ./Snippet.dhall

C:\xxx\makeSnippet.dhall:1:15
|- let makeSnippet = ./makeSnippet.dhall in makeSnippet "test" [ "test" ]

Ôå│ ./makeSnippet.dhall
  Ôå│ ./Snippet.dhall

I have this problem in dhall repl and in dhall repl --ascii as well. When running the Repl in Git Bash it works:

(input):2:1:
  |
2 | <empty line>
  | ^
unexpected end of input
expecting #!, expression, or whitespace

⊢ :let greeting = "hello"

greeting : Text

⊢ ./makeSnippet.dhall

↳ ./makeSnippet.dhall
  ↳ ./Snippet.dhall

Error: Invalid type for ❰List❱

I was really surprised to see that error diagnostics in --ascii invocation of the repl seem to use unicode characters as well - is that on purpose?

What i tried so far (without success):

  • Changing the font to Lucidca
  • Changing the font to DejaVu Sans Mono
  • Changing the codepage via chcp 65001

I would really like to use dhall with powershell. So any ideas how to solve this issues are highly welcome!

Many thanks in advance!

Julian

1

There are 1 best solutions below

0
On

This helped:

Displaying Unicode in Powershell

I had to enter

$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = 
New-Object System.Text.UTF8Encoding