-
Notifications
You must be signed in to change notification settings - Fork 220
List of Haskell Kata to Update
The following kata are not compatible with the new GHC 8.8.4. Please help with updating.
- (A+B)+C=A+(B+C)? Prove it!
- Ch02 - effective plusNat
Fill in the gaps in my timesheet.- Grouped by commas
- Hughes' List
- I Liked the SQL Better...
- Interpolation Phalanx
- Metric Units - 1
- Product Groups
- Regular expression parser
- Simple Interactive Interpreter
-
The most untyped typed language? - error
Simplifier ticks exhausted
?!? - What's a beet counter to do?
- What's a beet packer to do?
- Yet another Collatz kata
Tests for Haskell GHC 7.10 and GHC 8.2 on Codewars are not compatible for historical reasons.
Tests for GHC 7.10 works by wrapping Hspec/HUnit and using patched hspec
function to report the test results. This was very difficult to maintain, introduced unexpected behaviors, and confused users because Test.Hspec
is not actually Hspec.
The new runner supports multiple language versions so we decided to clean this mess up when adding GHC 8.2 support and use Hspec as is.
Test for GHC 7.10:
module ExampleTest where
import Test.Hspec
import Example
main :: IO ()
main = hspec $ do
describe "Example" $ do
it "add a b" $ do
(add 1 1) `shouldBe` (2 :: Integer)
can be updated by making the following changes:
module ExampleSpec where -- test module name MUST end with Spec
import Test.Hspec
import Example
spec :: Spec -- `spec` is required
spec = do
describe "Example" $ do
it "add a b" $ do
(add 1 1) `shouldBe` (2 :: Integer)
main :: IO () --- optionally keep `main`
main = hspec spec
More work might be necessary if it depends on GHC 7.10 environment somehow.
If a kata uses hidden
from Codewars wrapper, it needs to be rewritten using solutionShouldHide
solutionShouldHideAll
from Test.Hspec.Codewars. This needs to be imported explicitly in the test file.
Haskell version should be removed because this kata is pointless in Haskell (limitation cannot be enforced by virtue).
The following kata doesn't have GHC 8.2 supported:
nil
nil