Skip to content

Change :type to only print type in dhall-repl #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2018

Conversation

Gabriella439
Copy link
Collaborator

No description provided.

@ocharles
Copy link
Member

Hm, I modelled this on the behavior of GHCI (which echoes the expression), but not necessarily against this change.

@Gabriella439
Copy link
Collaborator Author

Yeah, the main reason I did it was because I was having difficulty visually picking out the type annotation. For example:

⊢ :type https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/List/replicate
      let replicate
          : Natural → ∀(a : Type) → a → List a
          =   λ(n : Natural)
            → λ(a : Type)
            → λ(x : a)
            → List/build
              a
              (   λ(list : Type)
                → λ(cons : a → list → list)
                → Natural/fold n list (cons x)
              )
  
  in  replicate
: ∀(n : Natural) → ∀(a : Type) → ∀(x : a) → List a

Part of the reason is that Dhall's type-level expressions are not as visually distinctive from term-level expressions as in Haskell since tin Dhall both terms and types use very similar punctuation

@Gabriella439 Gabriella439 merged commit 5d99c18 into master Apr 1, 2018
@Gabriella439 Gabriella439 deleted the gabriel/type_only branch April 1, 2018 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants