Add support for deriving strategies
jmchapman opened this issue · comments
James Chapman commented
module Strategy where
{-# FOREIGN AGDA2HS
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
#-}
open import Data.Bool
record B : Set where
field b : Bool
{-# COMPILE AGDA2HS B newtype deriving newtype (Eq, Show) #-}
would compile to:
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Strategy where
newtype B = B { b :: Bool }
deriving newtype (Eq, Show)
Currently trying to compile this produces this strange error:
An internal error has occurred. Please report this as a bug.
Location of the error: __IMPOSSIBLE__, called at src/full/Agda/Utils/FileName.hs:60:20 in Agd-2.6.3-a4d0c165:Agda.Utils.FileName
@omelkonian proposed a workaround in the meantime of using standalone deriving in a FOREIGN
block.
Jesper Cockx commented
Could you give an example of some Haskell code that you would like to be generated by agda2hs
?
James Chapman commented
@jespercockx I updated the description!