I'd like to put the definition of a top-level Agda module and a local anonymous module using it in the same file. However, the top-level module has parameters, and I'd like to instantiate it in the second module.
So basically I would like to do something like this:
module MyModule (A : Set) where
foo : A -> A
foo x = x
module _ where
open import Data.Bool
open MyModule Bool
bar = foo true
However, the open MyModule Bool
line fails with "The module MyModule
is not parameterized, but is being applied to arguments".
Is there a way to do this without:
putting the second module in a separate file
indenting the contents of
MyModule
, i.e. something likemodule _ where module MyModule (A : Set) where foo : A -> A foo x = x module _ where open import Data.Bool open MyModule Bool bar = foo true
?