On Mon, Dec 14, 2015 at 3:15 AM, martin <martin.drautzburg@web.de> wrote:
I started like this

data C a = C {
            insert :: a -> Maybe (C a),
            remove :: Maybe (a, C a)
        }

but I could not implement anything sensible on top of this.

And the reason you're stuck implementing anything sensible on top of this is because you've written an OOP-style specification of a data structure.

You might want to review how Haskell declares data types.

-- Kim-Ee