[Haskell-cafe] Need ideas how to model the lack of something

Kim-Ee Yeoh ky3 at atamo.com
Mon Dec 14 00:28:53 UTC 2015

On Mon, Dec 14, 2015 at 3:15 AM, martin <martin.drautzburg at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151214/8680f874/attachment.html>

More information about the Haskell-Cafe mailing list