Skip to content

Importing a name from a module Haskell.* should generate import #391

@HeinrichApfelmus

Description

@HeinrichApfelmus

I would like to import an external Haskell module, say, Data.ByteString. However, I am unable to generate the corresponding Haskell import statement.

More specifically: After #379 , I can create an Agda wrapper module Haskell.Data.ByteString

-- agda
module Haskell.Data.ByteString where

postulate
  ByteString : Set

However, when using this module, say, as

-- agda
module Test where

open import Haskell.Data.ByteString using (ByteString)

test : ByteString  ByteString
test x = x

{-# COMPILE AGDA2HS test #-}

the transpilation output is

-- Haskell
module Test where

test :: ByteString -> ByteString
test x = x

This is not what I had in mind, though — I was hoping that the transpilation output would include the import statement.

import Data.ByteString (ByteString)

As a workaround, I can add this import manually with FOREIGN AGDA2HS in the module Test, but this module is not the right place — ideally, I should be able to specify in Haskell.Data.ByteString that the postulated ByteString type is a Haskell identifier that comes from the module Data.ByteString.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions