I came across the instance Functor [::]
here but I don't understand the syntax and didn't find that anywhere in the code. What is the documentation saying?
A Functor is an inbuilt class with a function definition like − class Functor f where fmap :: (a -> b) -> f a -> f b. By this definition, we can conclude that the Functor is a function which takes a function, say, fmap() and returns another function.
Definition of functor : something that performs a function or an operation.
Functor in Haskell is a typeclass that provides two methods – fmap and (<$) – for structure-preserving transformations. To implement a Functor instance for a data type, you need to provide a type-specific implementation of fmap – the function we already covered.
Another simple example of a functor is the Maybe type. This object can contain a value of a particular type as Just , or it is Nothing (like a null value).
It's an instance for Data Parallel Haskell arrays.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With