Is your feature request related to a problem? Please describe.
I'm working with a lot of newtype on top of numeric types, (e.g. Double, Int, ...), and I recently got confused by fromAny which does not behave as expected with them, e.g, it returns Nothing.
ghci> Right df <- fromCsv "a,b,c\n1.3,2.5,7.2"
ghci> newtype BetterDouble = BetterDouble Double deriving (Show, Eq, Ord)
ghci> fromAny (snd $ head (head (toRowList df))) :: Maybe Double
Just 1.3
ghci> fromAny (snd $ head (head (toRowList df))) :: Maybe BetterDouble
Nothing
Describe the solution you'd like
Having a way to either extend, or add support for anything coercible to Double
Describe alternatives you've considered
For now, I'm using fromAny @Double followed by coerce, but I got surprised and I don't like surprise ;)
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
I'm working with a lot of newtype on top of numeric types, (e.g.
Double,Int, ...), and I recently got confused byfromAnywhich does not behave as expected with them, e.g, it returnsNothing.Describe the solution you'd like
Having a way to either extend, or add support for anything coercible to
DoubleDescribe alternatives you've considered
For now, I'm using
fromAny @Doublefollowed bycoerce, but I got surprised and I don't like surprise ;)Additional context
Add any other context or screenshots about the feature request here.