Open stdlib-h opened 3 years ago
Yeah! This would be a good idea.
haskell could maybe be
import Control.Monad
import Data.List
main = {code}
-- or: main = print $ {code}
I am on the edge if I want the print in there or not, for example if we run with wrapped on take 10 [0..]
it would print out the result, BUT if we do mapM_ print [1, 2, 3, 4, 5]
it would error as it can't call print on IO ()
we could do some magic to make it work
{-# LANGUAGE FlexibleInstances #-}
import Control.Monad
import Data.List
import System.IO.Unsafe (unsafePerformIO)
instance Show a => Show (IO a) where
show p = "IO " ++ (show $ unsafePerformIO p)
main = print $ {code}
but as the unsafePerformIO
says, it is unsafe.
we could also just not have any wrapping with haskell, seeing as it's main method is not really that complex to just write.
for wrapping.yml maybe we can add more header files or import more classes by
and add more for the other languages