[Haskell-cafe] Client-extensible heterogeneous types (Duck-typed variadic functions?)

Brandon Moore brandon_m_moore at yahoo.com
Wed Oct 13 23:27:08 EDT 2010


If you just want instances of questions you can keep it simple. How about something isomorphic to

data Instance = Instance { question : String, answer : String, check : String -> Bool }

You could make helper functions similar to your old code, like

addition : (Int , Int) -> Instance

You might handle problem families by taking a random number generator, or maybe using QuickCheck's Gen monad.

easyMultiplication : Gen Instance



      


More information about the Haskell-Cafe mailing list