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

Darren Grant dedgrant at gmail.com
Tue Dec 15 08:06:13 UTC 2015


'insert' is a record accessor, so there is an implied (C a).

Cheers,
D
On Dec 15, 2015 00:02, "Carlo Hamalainen" <carlo at carlo-hamalainen.net>
wrote:

> On 15/12/2015 15:33, Joachim Durchholz wrote:
> > I see Kim-Ee Yeoh stating that Martin is stuck without a way forward
> > due to using OO style, which seems more serious than just "wordy and
> > unnatural".
> > Or am I misreading his words, and that "OO-style" reference was just
> > descriptive rather than presenting the base cause of Martin's problems?
>
> The OP originally wrote an insert function with this type:
>
> insert :: a -> Maybe (C a)
>
> which sort of looks like an insert function from an OO language where
> the self object is implicit. In functional style it should be
>
> insert :: a -> C a -> Maybe (C a)
>
> Another way: it's impossible to implement
>
> insert :: a -> Maybe (C a)
> insert a = ???
>
> because there is no 'C a' to modify.
>
> --
> Carlo Hamalainen
> http://carlo-hamalainen.net
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151215/d886237d/attachment.html>


More information about the Haskell-Cafe mailing list