case getType tt of
Nothing -> error $ "Getting datacon index of untyped thing? " ++ pprString tt
Just ty -> case Type.splitTyConApp_maybe ty of
Nothing -> error $ "Trying to find datacon in a type without a tycon?" ++ pprString ty
Just (tycon, _) -> case TyCon.tyConDataCons_maybe tycon of
Nothing -> error $ "Trying to find datacon in a type without datacons?" ++ pprString ty
case getType tt of
Nothing -> error $ "Getting datacon index of untyped thing? " ++ pprString tt
Just ty -> case Type.splitTyConApp_maybe ty of
Nothing -> error $ "Trying to find datacon in a type without a tycon?" ++ pprString ty
Just (tycon, _) -> case TyCon.tyConDataCons_maybe tycon of
Nothing -> error $ "Trying to find datacon in a type without datacons?" ++ pprString ty