Module FlatCurry.Typed.Simplify

A simplifier for type-annotated FlatCurry programs. In particular, it replaces calls to Eq.== implementations by Prelude.==

Author: Michael Hanus

Version: April 2019

Summary of exported operations:

simpProg :: AProg TypeExpr -> AProg TypeExpr   
simpExpr :: AExpr TypeExpr -> AExpr TypeExpr   

Implements the following transformations:

  • simplify equality instance on lists
  • simplify EQ.== calls
  • simplify uses of otherwise: case otherwise of { True -> e1 ; False -> e2 } ==> e1
  • simplify application of Prelude.$: f $ e ==> f e
  • simplify Prelude.apply for partially applied first arguments

Exported operations:

simpExpr :: AExpr TypeExpr -> AExpr TypeExpr   

Implements the following transformations:

  • simplify equality instance on lists
  • simplify EQ.== calls
  • simplify uses of otherwise: case otherwise of { True -> e1 ; False -> e2 } ==> e1
  • simplify application of Prelude.$: f $ e ==> f e
  • simplify Prelude.apply for partially applied first arguments