Skip to content

Instantly share code, notes, and snippets.

@MarcelineVQ
Created March 12, 2019 23:41
Show Gist options
  • Save MarcelineVQ/96e2b90a771fd01480cbce4bc5a8d353 to your computer and use it in GitHub Desktop.
Save MarcelineVQ/96e2b90a771fd01480cbce4bc5a8d353 to your computer and use it in GitHub Desktop.
-- This works
Eitha : Type -> Type -> Type
Eitha b a = Either a b
[eitha]
Functor (Eitha b) where
map f (Left l) = Left (f l)
map f (Right r) = Right r
-- However, removing [eitha] results in the error:
-- Eitha b cannot be a parameter of Prelude.Functor.Functor
-- (Implementation arguments must be type or data constructors)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment