Nadrieril

Results 219 comments of Nadrieril

I think what we'd really want is an actual pattern matching syntax but that's obviously a whole other level of complexity. So I don't mind adding awkwarder features like the...

I think both are rather different features and would be both useful. I'm open to `==` for unions but I don't think it entirely replaces the need for wildcards

I'd be interested to see real-world examples where this is noticeable. Maybe we could add some of those examples to the test suite ?

> Alright looks like I can do this: > > ``` > let list/map = (../../Prelude.dhall).List.map > let list/map = (../../Prelude.dhall).Optional.map > ``` > > I am new to Dhall...

@Gabriel439 good idea! For similar reasons we could also make `Prelude.Map.Type` builtin, though that's an easier one for implementations to deal with.

Actually I was mistaken: we would need more than just `fold` and `build` to be usable: we also need `JSON.bool`, `JSON.object`, etc. to construct values. That's annoying because then `JSON`...

@philandstuff Oh, good point!

The reason we don't currently do this is that this would kill the totality of Dhall. The reason `List/fold` ensures totality is because it forces the function that "recursively" consumes...

EDIT: I had a more complicated approach earlier but this is better. That actually seems doable. Imagine we had a fixpoint operator for types that conceptually desugars to the quantification...

It depends how we handle value of type `fix(..) -> ...`. I would assume they are built with a special `Fix` constructor, that we would make invisible in the syntax....