New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metafont cleanup #16

Merged
merged 16 commits into from Sep 12, 2013

Conversation

Projects
None yet
2 participants
@bergey
Copy link
Member

bergey commented Sep 11, 2013

I think the Metafont code is in a state where other people could use it. Please try it out, find what I've missed.

This branch includes:
a) an implementation of the path solver described in The MetaFontBook and mf.web, resulting in Diagrams Trails
b) a Parsec parser implementing the string syntax used by MetaFont
c) a few tests producing SVGs that match diagrams in the MetaFontBook

Things I want to add, but I don't think prevent merging:
a) a proper quasiquoter with variable interpolation
b) a tutorial

Compared to the metafont branch, this branch:
a) works
b) is rebased onto current diagrams-contrib
c) does not have a separate commit for every off-by-one or sign- error I've found in the last two weeks :)

All these matrices of Doubles representing angles make me appreciate the Diagrams type system!

-- | MF.fromString is the primary interface to the MetaFont library.
-- It takes a ByteString in MetaFont syntax, and attempts to return a
-- TrailLike.
fromString :: (TrailLike t, V t ~ R2) => ByteString -> Either ParseError t

This comment has been minimized.

@byorgey

byorgey Sep 12, 2013

Member

Why a ByteString? Isn't it actually text (as opposed to a sequence of bytes)?

This comment has been minimized.

@bergey

bergey Sep 12, 2013

Author Member

You're right. I'm happy to switch to Parsec.Text.

This comment has been minimized.

@byorgey

byorgey Sep 12, 2013

Member

What's Parsec.Text? Did you mean Data.Text? In any case, I think Data.Text makes much more sense than ByteString, assuming it's not too difficult to switch at this point.

This comment has been minimized.

@byorgey

byorgey Sep 12, 2013

Member

I'm going to merge it now anyway, we can continue working on it in master.

This comment has been minimized.

@byorgey

byorgey Sep 12, 2013

Member

The build error seems to be a GHC 7.4 bug. I'm looking into a workaround.

@byorgey

This comment has been minimized.

Copy link
Member

byorgey commented Sep 12, 2013

Wow, that was fast =)

byorgey added a commit that referenced this pull request Sep 12, 2013

@byorgey byorgey merged commit e836175 into master Sep 12, 2013

1 check was pending

default The Travis CI build is in progress
Details

@byorgey byorgey deleted the metafont-cleanup branch Sep 12, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment