There is a Haskell program called inline-C which allows C code snippets to placed inline Haskell code, as follows:
main :: IO ()
main = do
x <- [C.block| int {
// Read and sum 5 integers
int i, sum = 0, tmp;
for (i = 0; i < 5; i++) {
scanf("%d", &tmp);
sum += tmp;
}
return sum;
} |]
print x
As you can see, there is a C code snippet above in between the [C.block|
and |]
.
Is there a way to make it so that portions of code in between these are highlighted as C code?