Skip to content

derive Data instance for basic Base types (e.g. System.Exit.ExitCode)

It might be extended to other built in types.

In my case I had a function returning Either (NonEmpty (Foo, Maybe Bar), a) i.e. ExitCode is buried very deep.

I wanted quickly tweak the value to make error message compatible with GHC8 and 9 through a trick biplate %~ (replace "x" "y") but user defined type Bar couldn't derive Data because it contains ExitCode without Data.

Edited by Daniil Iaitskov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information