3 ms·
Ropes remind me of Haskell's type ShowS = String -> String `Text` is generally preferred to `String` in Haskell, but I've happily written parsers that depen
by Syzygies 2y ago
Ropes remind me of Haskell's
type ShowS = String -> String
`Text` is generally preferred to `String` in Haskell, but I've happily written parsers that depend on `ShowS` to defer concatenation to linear time final output. `Text` to me always felt more C-like, and better suited to C-like applications.
I've survived in math partly by attempting to catalog how others think. I sense a divide in Haskell, between people who prefer to view the compiler as a hermetically sealed abstraction, and those of us who try exploit what we think the compiler is doing. To view `ShowS` as a rope one needs to consider how the compiler handles lazy evaluation.
- lupire 2y agoYou don't need to anything about the compiler internals to know that a String is a linked list, and that concatenating a linked list is expensive, and that ShowS is a function interface that enables optimized contatenation. Rope is a data structure, not a function. https://hackage.haskell.org/package/base-4.19.1.0/docs/GHC-Show.html#t:ShowS https://hackage.haskell.org/package/base-4.19.1.0/docs/GHC-S... https://hackage.haskell.org/package/base-4.19.1.0/docs/Data-String.html https://hackage.haskell.org/package/base-4.19.1.0/docs/Data-...
- Syzygies 2y agoData structures are useless without functions, and functions are useless without data structures. In use, ropes are like `ShowS`. It feels to me like you're making a grammatical distinction, of a kind I try to avoid so I can think more abstractly. Our categories are historical accident.