git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix isNullaryConstructor check
7050984Gary Burgess
src/Language/PureScript/CodeGen/JS.hs+6−3
@@ -399,6 +399,9 @@ isOnlyConstructor e ctor =
399
399
400isNullaryConstructor :: Environment -> Qualified ProperName -> Bool
400isNullaryConstructor :: Environment -> Qualified ProperName -> Bool
401isNullaryConstructor e ctor =
401isNullaryConstructor e ctor =
402− case fromMaybe (error "Data constructor not found") $ ctor `M.lookup` dataConstructors e of
402+ not . isFunction . snd . fromMaybe (error "Data constructor not found") $ ctor `M.lookup` dataConstructors e
403− (_, TypeConstructor{}) -> True
403+ where
404− _ -> False
404+ isFunction :: Type -> Bool
405+ isFunction (ForAll _ t _) = isFunction t
406+ isFunction (TypeApp t _) = isFunction t
407+ isFunction t = t == tyFunction