purescript-contrib/purescript-argonaut-codecs

Recursive newtype in not deriving

wclr opened this issue · 1 comments

wclr commented

Here is a simple modified example from docs with recursive newtype, and it is not deriving:

newtype AppUser = AppUser { name :: String, age :: Maybe Int, appUser :: AppUser }

derive instance newtypeAppUser :: Newtype AppUser _

derive newtype instance decodeJsonAppUser :: DecodeJson AppUser -- error
The value of decodeJsonAppUser is undefined here, so this reference is not allowed.
PureScript(CycleInDeclaration)

If it works as intended, probably it worth mentioning in the docs.

garyb commented

There's an issue open for this on the compiler repo: purescript/purescript#3407. Closing this one as it's not the library's fault.