chimney icon indicating copy to clipboard operation
chimney copied to clipboard

Consider renaming Result to TransformResult

Open Tvaroh opened this issue 1 year ago • 2 comments

Since one would need to write something like Result.fromOption, it can easily conflict with some other user-defined Result types. I believe it's bad idea to use this generic name, would be nice to rename. I'd suggest TransformResult.

Tvaroh avatar Mar 14 '23 13:03 Tvaroh

In Scala you can apply renaming locally in your code-base already, without waiting for a proper release/fix in the library.

Just do:

import io.scalaland.chimney.partial.{Result => TransformResult}

Long term - happy to consider renaming in case more people find it useful.

krzemin avatar Mar 14 '23 16:03 krzemin

I'd add that if you want to work with partials you might want to convert the errors to your own format which would require working with e.g. io.scalaland.chimney.partial.Error, io.scalaland.chimney.partial.Path and io.scalaland.chimney.partial.Errors.

Renaming them all to something with Transformation* prefix would be rather boilerplate'y, discouraging users from doing this. In our codebase we import io.scalaland.chimeny.partial and use partial.Error, partial.Result, partial.Path etc - without polluting io.scalaland.chimney namespace with types that most user's wouldn't use anyway.

MateuszKubuszok avatar Sep 30 '23 11:09 MateuszKubuszok

For now I'm closing this since importing package or rename on import works already.

MateuszKubuszok avatar Apr 25 '24 12:04 MateuszKubuszok