Arrow notation, existentials, and TcType demotion

2021-10-04 Thread Alexis King
Hello, As I mentioned in a previous email , GHC seems currently somewhat uncertain about whether or not matching on GADTs is permitted in arrow notation. Sam Derbyshire suggested on Twitter

RE: Instantiation of overloaded definition *in Core*

2021-10-04 Thread Simon Peyton Jones via ghc-devs
You can look it up in the class instance environment, which the Simplifier does have access to it. That's relatively easy when you have a simple dictionary like (Monad IO). But if you want (Eq [Int]) you first of all have to look up the (Eq [a]) dictionary, then the Eq Int dictionary, and

Instantiation of overloaded definition *in Core*

2021-10-04 Thread Erdi, Gergo via ghc-devs
PUBLIC Hi, I'd like to instantiate Core definitions. For example, suppose I have the following Core definition: foo :: forall m a b. Monad m => m a -> m b -> m b foo = \ @m ($d :: Monad m) @a @b (ma :: m a) (mb :: m b) -> ... Now let's say I'd like to instantiate it for m ~ IO. It is quite

Re: Optics?

2021-10-04 Thread Sebastian Graf
Hi Alan, hi Vlad, Yes, one thing that is nice about van Laarhoven lenses is that you don't actually need to depend on anything if all you want is export lenses in your API. We have also discussed using a small lens library in the past, in https://gitlab.haskell.org/ghc/ghc/-/issues/18693. The