You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason that Function and other types cannot be an instance of Costrong is that PureScript is a strict evaluation.
unfirst :: forall a b c. p (Tuple a c) (Tuple b c) -> p a b
That is, when we want to loop over c, it is impossible to set the initial value of c
How to modify it may be debatable, but I found the following solution
unfirstLazy :: forall a b c. Lazy c => p (Tuple a c) (Tuple b c) -> p a b
unfirstLazy f a = fst $ f $ Tuple a $ go
where
go = snd $ f $ Tuple a $ defer \_ -> go
Also, since this is not "Co" Strong, it might be better to name the class differently, for example CostrongLazy, or create a new library.
Thanks to natefaubion for sharing this issue on PureScript discord server.
The text was updated successfully, but these errors were encountered:
The reason that Function and other types cannot be an instance of Costrong is that PureScript is a strict evaluation.
That is, when we want to loop over c, it is impossible to set the initial value of c
How to modify it may be debatable, but I found the following solution
Also, since this is not "Co" Strong, it might be better to name the class differently, for example
CostrongLazy
, or create a new library.Thanks to natefaubion for sharing this issue on PureScript discord server.
The text was updated successfully, but these errors were encountered: