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

Functions defined with an absurd pattern get no definition in Haskell

flupe opened this issue · comments

If a function with a single clause is defined with an absurd pattern, only the type signature gets generated in the corresponding Haskell code.

impossible : @0 ⊥  a
impossible ()
{-# COMPILE impossible #-}
impossible :: a

We probably should have a default clause that throws a runtime error.

The idea was that you shouldn't use absurd patterns and instead make an explicit call to the error function.

Then it should be caught and prevented by agda2hs!