agda / agda2hs

Compiling Agda code to readable Haskell

Home Page:https://agda.github.io/agda2hs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation of non-erased module parameters

jespercockx opened this issue · comments

Currently agda2hs assumes that all non-erased module parameters are types and should be compiled to explicit foralls. For example:

module _ (x : Int) where
  
  foo : Int
  foo = x

{-# COMPILE AGDA2HS foo #-}

is compiled to

foo :: forall x . Int
foo = x

We should either compile the module parameter to a regular function argument, or else throw an error that non-type module parameters are not supported.

With current master, this compiles to:

foo :: Int
foo x = x

Still bogus, a bit less so. Investigating now.

This is fixed by #304