One way I make dwimmy designs is by listening to my heart.
Brain: "types are necessary, efficient, and useful"
Heart: "they get in the way, explicit conversions and annotations annoy me, it's code duplication, it's inflexible design, and ergo they suck"
Synthesis: "make some wrappers that do the conversion automatically, or use generics"
I'm not all the way there yet.
I have as-list, as-string, ->string, string->dwim etc but even using them is annoying!
I get that it cuts down on duplication that, if I have imported a frobnicate function that works on lists, I can (as-list frobnicate) get a version that works on everything, but even that is too much. If I am making a (define (foo bar) ...) and I need bar to always be strings, I can (define (foo (= ->string bar)) ...) but that's still too much!
The world of types is a world full of square pegs and round pegs and triangular pegs where I just want water.
My super educated big brain comp sci self knows all the good types can do. Efficiency and implementational minimalism. But I can't let myself get flimflammed by that big-brained self! Instead, I need to listen to my id that's like "but I wanna use reverse and member on strings and vectors!"
The fact that there are no typeclasses (in R5RS—there are plenty of libraries that provide (mutually incompatible) implementations of typeclasses) is what makes types in Scheme even more painful than even Haskell.
With typeclasses, there can be an isa-relationship between types and both a string and a list isa sequence so code could've been built to work on both.
Brain: "types are necessary, efficient, and useful"
Heart: "they get in the way, explicit conversions and annotations annoy me, it's code duplication, it's inflexible design, and ergo they suck"
Synthesis: "make some wrappers that do the conversion automatically, or use generics"
I'm not all the way there yet.
I have as-list, as-string, ->string, string->dwim etc but even using them is annoying!
I get that it cuts down on duplication that, if I have imported a frobnicate function that works on lists, I can (as-list frobnicate) get a version that works on everything, but even that is too much. If I am making a (define (foo bar) ...) and I need bar to always be strings, I can (define (foo (= ->string bar)) ...) but that's still too much!
The world of types is a world full of square pegs and round pegs and triangular pegs where I just want water.
My super educated big brain comp sci self knows all the good types can do. Efficiency and implementational minimalism. But I can't let myself get flimflammed by that big-brained self! Instead, I need to listen to my id that's like "but I wanna use reverse and member on strings and vectors!"
The fact that there are no typeclasses (in R5RS—there are plenty of libraries that provide (mutually incompatible) implementations of typeclasses) is what makes types in Scheme even more painful than even Haskell.
With typeclasses, there can be an isa-relationship between types and both a string and a list isa sequence so code could've been built to work on both.