Symbolic name as type constructor

Sorry, newbie question about Haskell ...

What do I need to do to use the infix character as a type constructor? I found the following piece of code, but GHC and GH complain of "Unexpected type` ~>" where a type variable is expected "...

class Category (~>) where
(.) :: (a ~> b) -> (b ~> c) -> (a ~> c)
id  :: a ~> a

How can I do that? Thank you very much in advance!

+4
source share
2 answers

Starting with GHC 7.6, everyone is TypeOperatorsalways a constructor . I am not sure why this is so, but I assume that this violation is not to violate even older code. Additional information on the mailing list.

+6
source

Source: https://habr.com/ru/post/1545512/


All Articles