Re: a reliable way of dropping levity args?

2016-01-29 Thread Ömer Sinan Ağacan
2016-01-29 3:36 GMT-05:00 Simon Peyton Jones : > > So you need something like > > isLevityCon :: Type -> Bool > isLevityCon (TyConApp tc []) = isLevityTy (tyConKind tc) > .. > > Please document both functions carefully > > ALSO there is a bug in

RE: a reliable way of dropping levity args?

2016-01-29 Thread Simon Peyton Jones
22:49 | To: Richard Eisenberg <e...@cis.upenn.edu> | Cc: ghc-devs <ghc-devs@haskell.org> | Subject: Re: a reliable way of dropping levity args? | | I finally had some time to have another look. I have this line in my | compiler pass: | | | Just (tc, args) <- spli

Re: a reliable way of dropping levity args?

2016-01-28 Thread Ömer Sinan Ağacan
asn't working for you. > What does (map idType args) say? > > Richard > > On Jan 24, 2016, at 8:58 PM, Ömer Sinan Ağacan <omeraga...@gmail.com> wrote: > >> Hi all, >> >> I'm looking for a reliable way of dropping levity args from TyCon >> app

Re: a reliable way of dropping levity args?

2016-01-28 Thread Ömer Sinan Ağacan
Ahh, levity is type of kinds, right? For some reason I thought kinds are now levities (or whatever it's called). This makes sense. I just tried and I think it works, thanks. 2016-01-28 19:39 GMT-05:00 Richard Eisenberg : > > On Jan 28, 2016, at 5:48 PM, Ömer Sinan Ağacan

Re: a reliable way of dropping levity args?

2016-01-28 Thread Ömer Sinan Ağacan
It might be nice to actually replace `drop (length args `div` 2) args` with a function `dropLevityArgs = dropWhile (isLevityTy . typeKind)` (I did this in my branch). When I see a code that drops half of the type arguments it doesn't make sense right away, but `dropLevityArgs` is at least giving

Re: a reliable way of dropping levity args?

2016-01-28 Thread Richard Eisenberg
On Jan 28, 2016, at 5:48 PM, Ömer Sinan Ağacan wrote: > >| Just (tc, args) <- splitTyConApp_maybe ty >, isUnboxedTupleTyCon tc >= pprTrace "elimUbxSumRepTypes" >(text "orig args:" <+> ppr args $$ > text "dropWhile isLevityTy args = " <+> ppr

Re: a reliable way of dropping levity args?

2016-01-28 Thread Richard Eisenberg
Levity is very simple: > data Levity = Lifted | Unlifted And that's it, as far as Levity is concerned. The weird thing is TYPE, whose type is Levity -> TYPE 'Lifted. (Yes. TYPE's type mentions TYPE.) The * of yore is now spelled TYPE 'Lifted. The # of yore is now spelled TYPE 'Unlifted. * and

a reliable way of dropping levity args?

2016-01-24 Thread Ömer Sinan Ağacan
Hi all, I'm looking for a reliable way of dropping levity args from TyCon applications. When I know that a particular TyCon gets some number of levity args, I can just drop the args manually (for example, I can drop the first half of arguments of a tuple TyCon application) but the code looks