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
Maybe I just missing some special Haskell syntax - but I don't find a good explanation for:
type MyMaybe :: Type -> Type
type MyMaybe = Maybe
type MyMaybe' :: Type -> Type
type MyMaybe' a = Maybe a
type Works = Fix MyMaybe
-- • The type synonym ‘MyMaybe'’ should have 1 argument, but has been given none
-- • In the type synonym declaration for ‘DoesntWork’
type DoesntWork = Fix MyMaybe'
Here for sure the argument can be avoided - but what if the type is nested - e.g. something like Either (Maybe a ) ()? How to apply Fix in such a case?
The text was updated successfully, but these errors were encountered:
In Haskell we can not use type-synonyms as functions from type to type. A type synonym should always be fully applied.
You can solve it by declaring the new datatype (using data or newtype).
Please excuse if this is a dumb question 😃
Maybe I just missing some special Haskell syntax - but I don't find a good explanation for:
Here for sure the argument can be avoided - but what if the type is nested - e.g. something like
Either (Maybe a ) ()
? How to applyFix
in such a case?The text was updated successfully, but these errors were encountered: