Re: Type checking expressions

2018-03-05 Thread Peter Podlovics
w what you need in your use-case. A type like ‘a’ might be a very >> fine answer! >> >> >> >> A lot depends on precisely what you are trying to do. >> >> >> >> Simon >> >> >> >> *From:* Peter Podlovics [mailto:peter.d.podlov...@gmail

Re: Type checking expressions

2018-03-05 Thread Robin Palotai
ov...@gmail.com] > *Sent:* 05 March 2018 14:54 > *To:* Simon Peyton Jones <simo...@microsoft.com> > *Subject:* Re: Type checking expressions > > > > My main concern with that approach is that it might not give the correct > type. For example the hsPatType function only

RE: Type checking expressions

2018-03-05 Thread Simon Peyton Jones via ghc-devs
il.com] Sent: 05 March 2018 14:54 To: Simon Peyton Jones <simo...@microsoft.com> Subject: Re: Type checking expressions My main concern with that approach is that it might not give the correct type. For example the hsPatType function only gives unconstrained types, so it is incorrect for a

RE: Type checking expressions

2018-03-05 Thread Simon Peyton Jones via ghc-devs
Peter My goal is to determine the type of every expression, pattern etc. in the syntax tree After type checking is complete, the syntax tree is liberally annotated with types. We do not yet have a function hsExprType :: HsExpr Id -> Type but we do have TcHsTyn.hsPatType