RE: about GHC API: Looking up names

2018-02-09 Thread Simon Peyton Jones via ghc-devs
Ranjit Have you read Note [The equality types story] in compiler/prelude/TysPrim? As you’ll see (~) is actually a class; the equality predicate is (~#). There doesn’t seems to be a named-function predicate that checks for it explicitly, but if you grep for eqTyCon you’ll see lots of tests for

RE: DoAndIfThenElse

2018-02-09 Thread Simon Peyton Jones via ghc-devs
I also recall that Idris and Elm have some do-syntax like this: do { x <- e1 ; Just y <- e2 | Nothing -> exceptional-code ; etc ; etc } That is, e2 :: blah -> IO (Maybe t), we can pattern match on the expected Just case, but still provide code for the Nothing case

RE: DoAndIfThenElse

2018-02-09 Thread Simon Peyton Jones via ghc-devs
At very least the extension should be documented! Would you like to open a ticket for that? And even offer a patch? Thanks for pointing this out. Simon From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Harendra Kumar Sent: 09 February 2018 02:43 To: Brandon Allbery Cc: ghc-dev

RE: StgLint worth maintaining?

2018-02-09 Thread Simon Peyton Jones via ghc-devs
Good summary! I suggest that you open a ticket with this email as the Description. Then we can point to it later. I agree that there is little point in flogging a dead horse. But there are /some/ invariants, so I vote for | 2. Rewrite it to only check these two and nothing else, enable it in

StgLint worth maintaining?

2018-02-09 Thread Ömer Sinan Ağacan
Hi, I've been looking into some StgLint-related tickets: - #13994: Found a StgLint problem and fixed, there's another problem waiting to be fixed. Both related with the fact that after unarisation we lose even more typing information and type checks needs to be relax