a reliable way of dropping levity args?

Richard Eisenberg eir at cis.upenn.edu
Mon Jan 25 12:30:12 UTC 2016

As discussed on IRC, your approach below looks right to me: dropWhile (isLevityTy . idType) args. But you then said this wasn't working for you. What does (map idType args) say?


On Jan 24, 2016, at 8:58 PM, Ömer Sinan Ağacan <omeragacan at gmail.com> wrote:

> 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 fragile (what happens if I use a
> different TyCon in the future) and confusing to the reader because it looks
> like this:
>    drop (length args `div` 2) args
> Ideally it'd look like this:
>    dropWhile isLevityArg args
> Now, there's a function called isLevityTy, but I don't understand what it's
> supposed to do. This doesn't do anyting to 'Boxed and 'Unboxed arguments:
>    dropWhile (isLevityArg . idType) args
> Any ideas on this?
> Thanks..

More information about the ghc-devs mailing list