Options

Diagrams in Haskell

edited April 2018 in Chat

Brent Yorgey's diagrams package is a great learning aid for CT being based on eg. his Monoid paper and his Typeclassopedia.

I did a not so quick but dirty hack of the SymmetryCube example in the gallery to produce a pullback diagram. There is also a ready-made Hasse diagram.

Here's a .png file:

Pullback

The source is here.

And there are some interesting suggestions for future development.

Comments

  • 1.

    I was actually going to start using this over the weekend to help me write up my (mostly handwritten and hand drawn) exercise answers.

    There's also an add-on for emacs' org-mode to include diagrams code inline. It can then render it when exporting to some other format (like markdown, LaTeX, or HTML).

    Comment Source:I was actually going to start using this over the weekend to help me write up my (mostly handwritten and hand drawn) exercise answers. There's also an add-on for emacs' org-mode [to include diagrams code inline](https://github.com/bergey/org-babel-diagrams). It can then render it when exporting to some other format (like markdown, LaTeX, or HTML).
  • 2.

    Hi @Jared. Thanks for the link - just what's needed for development. I'm trying to do the same as you with my answers so far. Sadly I just had to buy a new box and am too swamped to install nixos. I've only just got git for Win 10 to work but emacs has been a total fail so far.

    Comment Source:Hi @Jared. Thanks for the link - just what's needed for development. I'm trying to do the same as you with my answers so far. Sadly I just had to buy a new box and am too swamped to install nixos. I've only just got git for Win 10 to work but emacs has been a total fail so far.
  • 3.
    edited April 2018

    Yeah, getting emacs doing everything right on Windows can be a pain. I have to do that at work, but there I just accepted emacs was going to be an editor and not really interact with other programs.

    And a headsup, something I discovered when working with John's lecture markdown files. Github-flavored markdown really wants the files to use \n for the line terminator. \r\n (typical on windows) gives it fits (this is why there are the diamond-with-question-mark symbols in your README.md file as rendered on Github).

    Comment Source:Yeah, getting emacs doing everything right on Windows can be a pain. I have to do that at work, but there I just accepted emacs was going to be an editor and not really interact with other programs. And a headsup, something I discovered when working with John's lecture markdown files. Github-flavored markdown *really* wants the files to use `\n` for the line terminator. `\r\n` (typical on windows) gives it fits (this is why there are the diamond-with-question-mark symbols in your README.md file as rendered on Github).
  • 4.

    I've adapted the Hasse Diagram example for subsets for other posets from Math.Combinatarics.Poset. It is only drawing the arrows between adjacent levels which are wrong as of now. Github Repo

    Comment Source:I've adapted the Hasse Diagram example for [subsets](http://www.cs.rochester.edu/u/ryates/diagrams/doc/gallery/Hasse.html) for other posets from Math.Combinatarics.Poset. It is only drawing the arrows between adjacent levels which are wrong as of now. [Github Repo](https://github.com/Cobord/Azimuth-Applied-Category-Theory)
  • 5.

    Fixed it up so now for example the command "pad 1.1 $ withConnections2 (PS.posetD 24) 1" produces what is shown as the example divisorPoset.svg there. How do I link the images into the comment?

    Comment Source:Fixed it up so now for example the command "pad 1.1 $ withConnections2 (PS.posetD 24) 1" produces what is shown as the example divisorPoset.svg there. How do I link the images into the comment?
  • 6.

    Ammar, you can use the (somewhat odd) syntax ![](image_URL_here) to embed an image.

    Comment Source:Ammar, you can use the (somewhat odd) syntax \!\[](image_URL_here) to embed an image.
Sign In or Register to comment.