blog.poucet.org Rotating Header Image

January 21st, 2008:

Literate Haskell and C

Fun little fact that came up today in #haskell on IRC. You can have haskell code and C code in the same file (actually, you can do this with any language that allows multiline comments).


/* c and lhs file

>
> module Foo where
> main = print "Haskell"
>

*/
#include

int main() {
printf("C\n");
return 0;
}