I’m still not sure if it’s a wanted feature but it would definitely allow people to write dryer code in madlib.
class Show a {
show :: a -> String
}
instance Show Number {
show = (num) => #- num.toString() -#
}
instance Show a => Show List a {
show = (xs) => pipe(
map(show),
intercalate(“,”),
wrap(“[“, “]”)
)(xs)
}
Show Number would most likely be implemented by prelude and need the host support to make the conversion happen.
I’m still not sure if it’s a wanted feature but it would definitely allow people to write dryer code in madlib.
Show Number would most likely be implemented by prelude and need the host support to make the conversion happen.