Skip to content

'let' getting changed into 'case' in a RULE #178

@roboguy13

Description

@roboguy13

I have a RULE:

{-# RULES "abs/let-float" [~]
    forall x v.
    abs (let bnd = v in x)
      =
    let bnd = v
    in
    abs x
  #-}

When I try to bring it into a lemma with rule-to-lemma (or look at it with show-rule), it "becomes":

abs/let-float (Not Proven)
  ∀ △ △ $dLift $d~ x v.
  abs ▲ $dLift $d~
      (case v of bnd ▲
         _ → x)
  ≡
  case HEq_sc ▲ ▲ ▲ ▲ ($p1~ ▲ ▲ ▲ $d~) of cobox ▲
    _ →
      case v of bnd ▲
        _ → abs ▲ $dLift (($d~ ▹ (■ ∷ ▲ ~R ▲)) ▹ (■ ∷ ▲ ~R ▲)) x

I imagine this is something GHC is doing, not HERMIT. As a result of this (I think), I cannot apply it where I would like to (where there is a let, not a case). I know that case and let have different semantics in Core with regard to strictness, so I imagine this is why I can't apply it in those places.

Is there a way around this or a way to tell it to keep it as let?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions