I’m currently reading All About Monads in this site. And the Sheep definition is not defined. It’s defined as type Sheep = ...
A lot of the examples use the type definition Sheep but it’s defined as:
type Sheep = ...
father :: Sheep -> Maybe Sheep
father = ...
mother :: Sheep -> Maybe Sheep
mother = ...
I can’t continue with the exercises, Is it supposed to be an exercise? I’m confused because I can’t follow along the examples provided. The type is used throughout the page, and the Sheep definition is repeatedly used. GHCi does not allow the definition, so I’m a bit lost. The example is near the top of the page under the An Example page. If anyone can explain why this is, or how I can get around it, I would appreciate it.
I wouldn’t necessarily recommend using the wiki as a first learning resource. It isn’t (at least this is my impression) curated towards being a polished resource for someone learning the language (as examples like this show, and tbh, I wish it had a big disclaimer on it to avoid this sort of confusion).
Yeah, I’ve been through them so I’m not a complete beginner. I’m just trying to figure out Functors, Monads, Monoids, Category Theory etc. at the moment.