juan_gandhi: (Default)
[personal profile] juan_gandhi
Until I was told to take a look at coalgebras, and figured out that input deals with codata, and output deals with data, and that StringReader consists of mapping an algebra to a coalgebra, over the same affine functor, X -> AX + 1, I could not figure out how to properly connect my binary files with parser combinators... and the whole functioning of parser combinators in general.

The main point is that parser combinators work not on data, but on codata. So there.

Date: 2011-01-30 05:38 pm (UTC)
From: [identity profile] antilamer.livejournal.com
Have you considered iteratees?

Date: 2011-01-30 05:50 pm (UTC)
From: [identity profile] ivan-gandhi.livejournal.com
Interesting idea. No, I have not, but have to think about it.

Date: 2011-01-30 05:52 pm (UTC)
From: [identity profile] antilamer.livejournal.com
Well, they're exactly what you're talking about :) Look at attoparsec and at attoparsec-iteratee. There's also maybe a dozen other iteratee-related packages on hackage.

Date: 2011-01-30 05:53 pm (UTC)
From: [identity profile] antilamer.livejournal.com
Oops, I misunderstood your post. Oh well, iteratees are interesting anyway..

Date: 2011-01-31 07:46 am (UTC)
From: [identity profile] thedeemon.livejournal.com
When you're saying it is codata, are you really saying anything more than "it's an abstract data type"?

Date: 2011-01-31 08:04 am (UTC)
From: [identity profile] ivan-gandhi.livejournal.com
I don't know what is "abstract data type".

What I want to say is this: data are algebras, codata are coalgebras, over a certain functor (aka constructor).

Date: 2011-01-31 11:12 am (UTC)
From: [identity profile] thedeemon.livejournal.com
ADT hides its internal structure and is accessible by certain defined operations with it. Very close to coalgebra, as I understand.

Date: 2011-01-31 12:18 pm (UTC)
From: [identity profile] ivan-gandhi.livejournal.com
Except that, with such a vague definition, algebras will almost fit as well. But strictly speaking, yes, it is a coalgebra.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 2345 6 7
8 9 10 11 121314
15161718 1920 21
222324252627 28
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 30th, 2025 08:49 am
Powered by Dreamwidth Studios