[Haskell-cafe] self-referential data

brian brianchina60221 at gmail.com
Sat Aug 9 19:11:39 EDT 2008


On Sat, Aug 9, 2008 at 5:18 PM, Brent Yorgey <byorgey at seas.upenn.edu> wrote:
> The problem is that BString is not a type, it is a data constructor.

I know.

> You could use M.Map BValue BValue, but of course that's probably not
> what you want either.

Right. That wouldn't be according to spec either.

> What's wrong with just using 'String' as the Map key?

It seems wrong. Yeah, it's just a String, but we're being all abstract
because that's better practice. It happens that when you parse
bencoded data, the length of the string is given. Maybe I want to
store that in BString, too.

But mainly I want to know how to think about it differently so that I
know what to do when it comes up again and actually matters.


More information about the Haskell-Cafe mailing list