[Haskell-cafe] Type checking the content of a string

Brent Yorgey byorgey at seas.upenn.edu
Sat Feb 23 21:53:27 CET 2013


On Fri, Feb 22, 2013 at 06:44:06PM +0100, Corentin Dupont wrote:
> Hi all,
> I have a program able to read another program as a string, and interpret it
> (using Hint).
> I'd like to make unit tests, so I have a file "Test.hs" containing a serie
> of test programs as strings.
> However, how could I be sure that these test program are syntactically
> valid, at compile time?

If you just want to check whether a program is syntactically valid,
you can use the haskell-src-exts package to parse it.  If you also
want to do some type checking you can try the haskell-type-exts
package.

-Brent



More information about the Haskell-Cafe mailing list