I was trying to use mapM from agda2hs and when I compiled it I am getting the output:
agda2hs failed:
<...>: error: [CustomBackendError]
agda2hs:
illegal instance: Haskell.Prim.Traversable.traverse=
Haskell.Prim.Traversable.traverseList
The code I got it to fail on was as follows:
usingMapM : Maybe (List Nat)
usingMapM = mapM pure []
{-# COMPILE AGDA2HS usingMapM #-}
The other thing that confused me is that when I inlined the definition of traverse=_ into iTraversableList in lib/base/Haskell/Prim/Traversable.agda to
iTraversableList : Traversable List
- iTraversableList = traverse= traverseList
+ iTraversableList = record {DefaultTraversable (record {traverse = traverseList})}
without making any other changes it seemed to work.
I am not quite sure what is going on so I wanted to make an issue since I think this might happen again in other places where there is a record created from a default record with a helper (I don't think there are any other instances of it within base).
I was trying to use
mapMfrom agda2hs and when I compiled it I am getting the output:The code I got it to fail on was as follows:
The other thing that confused me is that when I inlined the definition of
traverse=_intoiTraversableListinlib/base/Haskell/Prim/Traversable.agdatowithout making any other changes it seemed to work.
I am not quite sure what is going on so I wanted to make an issue since I think this might happen again in other places where there is a record created from a default record with a helper (I don't think there are any other instances of it within base).