'insert' is a record accessor, so there is an implied (C a).
Cheers,
D
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@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe