@@ -5,7 +5,7 @@ module ProjectM36.Arbitrary where
55import ProjectM36.Base
66import ProjectM36.Error
77import ProjectM36.AtomType
8−import ProjectM36.Attribute (atomType)
8+import ProjectM36.Attribute (atomType,attributeName)
99import ProjectM36.DataConstructorDef as DCD
1010import qualified Data.Map as M
1111import qualified Data.Set as S
@@ -62,13 +62,15 @@ arbitrary' BoolAtomType = do
6262
6363arbitrary' (IntervalAtomType atomTy) = do
6464 tcMap <- ask
65− eitherAtomType <- lift $ runReaderT (arbitrary' atomTy) tcMap
66− case eitherAtomType of
67− Left err -> pure $ Left err
68− Right atomType -> do
69− a <- lift $ (arbitrary :: Gen Bool)
70− b <- lift $ (arbitrary :: Gen Bool)
71− pure $ Right $ IntervalAtom atomType atomType a b
65+ eitherAtomTypeA <- lift $ runReaderT (arbitrary' atomTy) tcMap
66+ eitherAtomTypeB <- lift $ runReaderT (arbitrary' atomTy) tcMap
67+ case (eitherAtomTypeA,eitherAtomTypeB) of
68+ (Right a, Right b) -> do
69+ l <- lift $ (arbitrary :: Gen Bool)
70+ r <- lift $ (arbitrary :: Gen Bool)
71+ pure $ Right $ IntervalAtom a b l r
72+ (Left err,_) -> pure $ Left err
73+ (Right _, Left err) -> pure $ Left err
7274
7375arbitrary' constructedAtomType@(ConstructedAtomType tcName tvMap) = do
7476 tcMap <- ask