Re-exporting an implementation without exporting the definition

Viewed 33

Suppose I have module M1 that defines a type in terms of another, existing type:

module M1 

import public Control.Monad.Identity

public export M : Type -> Type
M = Identity

I can of course import M1 and use M anywhere expecting an Applicative:

module M2

import M1

bar : M ()
bar = pure ()

But what if I don't want to export M's definition? In other words, I'd like to write

export M :: Type -> Type
M = Identity

so that client code can't depend on M's definition, but I would still like client code to be able to access Applicative M.

0 Answers
Related