@@ -399,6 +399,9 @@ isOnlyConstructor e ctor =
399399
400400isNullaryConstructor :: Environment -> Qualified ProperName -> Bool
401401isNullaryConstructor e ctor =
402− case fromMaybe (error "Data constructor not found") $ ctor `M.lookup` dataConstructors e of
403− (_, TypeConstructor{}) -> True
404− _ -> False
402+ not . isFunction . snd . fromMaybe (error "Data constructor not found") $ ctor `M.lookup` dataConstructors e
403+ where
404+ isFunction :: Type -> Bool
405+ isFunction (ForAll _ t _) = isFunction t
406+ isFunction (TypeApp t _) = isFunction t
407+ isFunction t = t == tyFunction