This repository has been archived by the owner on Sep 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinit.sql
3 lines (3 loc) · 1.88 KB
/
init.sql
1
2
3
insert into "user" values (DEFAULT, 'admin', 'admin', TRUE);
insert into problem values (DEFAULT, 'Hello World', 1, 'Write a function <code>hello</code> that prints out "Hello world!".', 'Hello', E'{-# LANGUAGE NoImplicitPrelude #-}\nmodule Hello where\nimport Test.IOSpec (IOSpec, Teletype, putStrLn)\ntype IO a = IOSpec Teletype a\n\nhello :: IO ()\nhello = undefined', E'{-# LANGUAGE NoImplicitPrelude #-}\nmodule Hello where\nimport Test.IOSpec (IOSpec, Teletype, putStrLn)\ntype IO a = IOSpec Teletype a\n\nhello :: IO ()\nhello = putStrLn "Hello world!"', E'import Test.Hspec\nimport Test.IOSpec\nimport Hello (hello)\n\ngetOutput :: Effect () -> String\ngetOutput (Done _) = ""\ngetOutput (Print c eff) = c : getOutput eff\ngetOutput _ = " ERROR"\n\nmain :: IO ()\nmain = hspec $\n describe "hello" $\n it "prints out \\"Hello world!\\" correctly" $\n getOutput (evalIOSpec hello singleThreaded) `shouldBe` "Hello world!\\n"\n', TRUE);
insert into problem values (DEFAULT, 'Prime Number', 1, 'Compute a list <code>primes</code> that contains at least the first 100 prime numbers.', 'Prime', E'module Prime where\n\nprimes :: [Integer]\nprimes = undefined', E'module Prime where\n\nprimes :: [Integer]\nprimes = filterPrime [2..] \n where filterPrime (p:xs) = p : filterPrime [x | x <- xs, x `mod` p /= 0]', E'import Test.Hspec\nimport Prime\n\nfirst100primes :: [Integer]\nfirst100primes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541]\n\nmain :: IO ()\nmain = hspec $\n describe "test" $\n it "computes prime numbers" $\n take 100 primes `shouldBe` first100primes\n', TRUE);