Compare things with α-equivalence

Open
#479 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
57/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
haskell
Domain
compilers

Research direction

Start in src/Agda2Hs/Compile/Function.hs at the two locations linked in the issue, and trace how the compiler compares function types and patterns when compiling extractSoloAnn to extractSolo. The example shows that type variable and pattern variable names may differ under α-equivalence; find the relevant tests and add coverage for this example. Done when the example compiles successfully.

Written by the indexing model from the issue text.

Description

bug

agda2hs complains when compiling the following code currently:

{-# OPTIONS --erasure #-}

module Issue479 where

open import Haskell.Prelude

data Solo (a : Type) : Type where
  MkSolo : a → Solo a
{-# COMPILE AGDA2HS Solo #-}

data SoloAnn (@0 a : Type) (b : Type) : Type where
  MkSolo : @0 a → b → SoloAnn a b
{-# COMPILE AGDA2HS SoloAnn to Solo #-}

extractSolo : Solo a → a
extractSolo (MkSolo x) = x
{-# COMPILE AGDA2HS extractSolo #-}

extractSoloAnn : ∀ {@0 a} → SoloAnn a b → b  -- type var names don't match
extractSoloAnn (MkSolo _ y) = y              -- pattern var name don't match
{-# COMPILE AGDA2HS extractSoloAnn to extractSolo #-}

Places to change (probably more?):

Dominant language
Agda
Stars
211
Forks
51
Avg merge
1d 12h
Merged PRs (30d)
11

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from agda/agda2hs

All issues in agda/agda2hs

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.