Skip to content

Instantly share code, notes, and snippets.

View sfogarty's full-sized avatar

Seth Fogarty sfogarty

  • Trinity University
  • San Antonio, TX
View GitHub Profile
@sfogarty
sfogarty / IdealSolution.hs
Last active June 11, 2020 18:00
Monadic Test Frameworks with Grading
import Control.Monad.Trans.Writer
type Rubric = [Bool] -> Int
data TestSeries = Test String (IO Bool) | Block String [TestSeries] Rubric
type Spec a = Writer [TestSeries] a
shouldBe :: Eq a => a -> a -> IO Bool
shouldBe x y = return (x == y)