{-# OPTIONS -fglasgow-exts -fallow-overlapping-instances #-}
{-% DrIFT (Automatic class derivations for Haskell) v1.2 %-}
module Test where

import ATermLib

data SortA = A1 SortA SortB
           | A2
           deriving (Read,Show,Eq)
data SortB = B1 SortA
           deriving (Read,Show,Eq)

{-! global : ATermConvertible !-}
{-* Generated by DrIFT-v1.2 : Look, but Don't Touch. *-}
instance ATermConvertible SortA where
    toATerm (A1 aa ab) = (AAppl "A1" [ toATerm aa,toATerm ab ])
    toATerm A2 = (AAppl "A2" [ ])
    fromATerm (AAppl "A1" [ aa,ab ]) = let aa' = fromATerm aa
					   ab' = fromATerm ab in (A1 aa' ab')
    fromATerm (AAppl "A2" [ ]) = let in A2
    fromATerm u = fromATermError "SortA" u

instance ATermConvertible SortB where
    toATerm (B1 aa) = (AAppl "B1" [ toATerm aa ])
    fromATerm (AAppl "B1" [ aa ]) = let aa' = fromATerm aa in (B1 aa')
    fromATerm u = fromATermError "SortB" u

--  Imported from other files :-

