nick8325 / quickspec

Equational laws for free
BSD 3-Clause "New" or "Revised" License
250 stars 24 forks source link

Language-specific formatters #69

Open isovector opened 4 years ago

isovector commented 4 years ago

Someone (I can't remember who, sorry!) suggested that QuickSpec support a more generalized test formatter, capable of writing tests for languages other than Haskell. This seems extremely valuable to me, so I wanted to sketch out what I've been thinking. Happy to send a PR if you're interested, @nick8325 .

data Equation = Equation
  { binders :: [(Name, Type)]
  , lhs :: Expr
  , rhs :: Expr
  , ty :: Type
  , eqSort :: EqualitySort
  }

--   '==' vs '=~='
data EqualitySort = Equational | Observational

customFormatter :: (Equation -> String) -> PrintStyle

plus maybe some formatters for expressing Exprs in different ways.