{-# LANGUAGE EmptyDataDecls, FlexibleContexts , FlexibleInstances, MultiParamTypeClasses, ScopedTypeVariables , TemplateHaskell, UndecidableInstances #-} {-# OPTIONS -Wall -fno-warn-missing-signatures #-} module SYBInstances where import Graphics.UI.SybWidget.MySYB hiding (NoCtx, noCtx) data Tree a = Tree (Tree a) (Tree a) | Leaf a deriving (Show, Eq) data Eternal = Eternal (Eternal) data ThreeProd a b c = ThreeProd { one :: a, two :: b, three :: c } -- |The context for generic autoform data NoCtx a noCtx :: Proxy NoCtx noCtx = error "noCtx" isTree :: Tree a -> Bool isTree (Leaf _) = False isTree (Tree _ _) = True -- |Instantiation of the Sat class instance Sat (NoCtx a) $(derive [''Tree, ''Eternal, ''ThreeProd])