[Haskell-beginners] Literate Haskell in Markdown but not Bird style

Brent Yorgey byorgey at seas.upenn.edu
Thu Jun 5 16:30:14 UTC 2014

On Thu, Jun 05, 2014 at 12:53:05AM -0600, Dimitri DeFigueiredo wrote:
> Thanks. I wanted to use the fenced version like so.
> ```haskell
> myFunction :: Int -> String
> -- some code goes here
> ```

OK.  Unfortunately it is not possible to get GHC to recognize code in
that format without some preprocessing.

> I find that typing with the Bird style, I get lots of '>' left behind
> at the end of lines causing syntax problems before I compile. It also
> makes it harder for me to reformat the code. For example, 'unindent
> block' no longer works on my editor.

Sounds like the real issue is that you need better editor support.
What editor are you using?  I am just curious, I am not going to
suggest that you change editors. =)


> Em 04/06/14 19:45, Brent Yorgey escreveu:
> >On Wed, Jun 04, 2014 at 04:58:27PM -0600, Dimitri DeFigueiredo wrote:
> >>Hi All,
> >>
> >>Is there a way to use literate haskell with GHC using Markdown but
> >>*not* using the Bird style for the code?
> >>It seems either one uses Bird style or has to put latex style
> >>\begin{code} markup (which markdown doesn't hide)
> >Those are the only two styles which GHC accepts.
> >
> >>In other words, is there a way to mark up the code in Markdown in a
> >>way that GHC understands without having to preprocess the file? I
> >>just wanted to write a .lhs file in markdown like I write a .hs file
> >>today.
> >If you are willing/able to use pandoc, it implements a special version
> >of Markdown for .lhs files which understands Bird tracks.  See
> >
> >   http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown
> >
> >-Brent
> >_______________________________________________
> >Beginners mailing list
> >Beginners at haskell.org
> >http://www.haskell.org/mailman/listinfo/beginners
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners

More information about the Beginners mailing list