[Haskell-cafe] Need ideas how to model the lack of something
martin.drautzburg at web.de
Mon Dec 14 07:03:26 UTC 2015
Am 12/13/2015 um 11:57 PM schrieb Patrick Redmond:
> I think you're off to a good start with this insert signature:
> insert :: a -> C a -> Maybe (C a)
> "Insert element `a` into structure `C a` and return a new structure if the insertion was successful."
This way I'd have to be explicit about what C really is, don't I? Data.Set certainly has a very explicit data structure
under the hood. I was hoping to express the idea of "something that can be inserted to and removed from" without
specifying how the data is actually stored.
But maybe that's a bad point to start from. At least this is where the trouble started when I tried to implement
something on top of it. I just didn't have enough "flesh" to work with.
More information about the Haskell-Cafe