Fri 31 Jul 2009
Slides from Hac Phi: “All About Monoids”
Posted by Edward Kmett under Haskell , Mathematics , Monoids , Parsing[10] Comments
Some people have requested my slides from the short talk I gave about monoids and monoidal parsing at Hac Phi. So, here they are.
There will be more to come at the next Boston Haskell User Group in August, where it looks like I'll be giving two short talks covering monoids. I may use the monoidal parsing engine from Kata as an example for the advanced talk if I have time and will start to cover parsing larger classes of grammars in general (regular languages, CFGs/TIGs, TAGs, PEGs, LALR, attribute-grammars, etc.)
July 31st, 2009 at 1:21 pm
How does one actually view the slides? The zip file seems to contain a large number of xml and .xml.rels files, but nothing to click on such as a pdf or even a powerpoint file.
July 31st, 2009 at 1:56 pm
Brett: Looks like a Powerpoint 2007 file.
If you have Powerpoint 2003, try http://www.microsoft.com/downloads/details.aspx?FamilyId=941b3470-3ae9-4aee-8f43-c6bb74cd1466&displaylang=en.
July 31st, 2009 at 2:26 pm
Can someone dump this to PDF? Or are the transitions too tasty to give up?
July 31st, 2009 at 2:43 pm
PDF:
http://www.mediafire.com/file/anifmxlzfgm/AllAboutMonoids.pdf
July 31st, 2009 at 3:04 pm
So when is this August meeting of the Boston Haskell Users Group? I want to attend but can’t seem to find information about it.
July 31st, 2009 at 3:13 pm
@Raynbow: Thanks!
@wwkeyboard: It should be around the week of the 17th. Ravi was waiting to see what Norman Ramsey’s schedule was like before setting it in stone since we keep scheduling it when he can’t show up!
July 31st, 2009 at 4:18 pm
@EdwardK:
np :). Btw, there’s a small mistake in the definition of Endo’s mempty in your slides. “id” should be wrapped within Endo.
Also, Gravatars don’t seem to work on this blog when using capital letters in the email address.
July 31st, 2009 at 10:49 pm
@RayNBow: Yeah, I spotted it during the talk, but didn’t fix the slides, woops!
Re: the gravatar thing, hrmm. It is funny that they should be case insensitive given that at least the portion before the @ should technically be handled case sensitively per RFC 2821 (though requiring this is explicitly called out as not being nice in the RFC).
The wordpress gravatar php function seems to be implemented along the guidelines of the other examples on gravatar which only trim whitespace and don’t change case. (i.e. http://en.gravatar.com/site/implement/textpattern)
So I’m thinking that the only way to portably get your gravatar to work on everyone’s site is to explicitly lowercase it yourself since anyone else doing it could incorrectly mangle an email address. ;)
I’d not be adverse to fixing it, since after all case sensitive email addresses don’t seem to really exist in practice, but currently the fragment looks like < ?php gravatar("R", 40); ?> and calls off to some method in some library somewhere, which already knows the email address in question. If I ever learned php, I might know where to find it. :)
[Edit: I did at least tweak your email address to be lowercase. ;) ]
August 2nd, 2009 at 9:01 am
Hi, do you have a working code example for the file position example? I get following error:
`Reducer SourcePosition’ is not applied to enough type arguments
Expected kind `*’, but `Reducer SourcePosition’ has kind `* -> *’
In the instance declaration for `Reducer SourcePosition’
August 3rd, 2009 at 6:33 am
@Stulli
Look on hackage at any revision of monoids before 0.2.0, and it will contain Data.Monoid.Lexical.SourcePosition — I recently slimmed the package down and plan to move the remaining functionality into a monoid-extras style package so that the core functionality is available without a laundry list of dependencies.
Your kind error comes from the fact that when I added Pos, I added an argument to the type to make it a Pointed Functor. So you need to make Monoid (SourcePosition f) and Reducer Char (SourcePosition f).
I explained the extra argument as part of the narrative during the talk, but naked slides do not provide me such opportunity for elaboration. :)