Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax in Haskell "Functor [::]"

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?

like image 666
Jake Avatar asked Jun 24 '13 22:06

Jake


People also ask

How do you define a functor in Haskell?

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.

What does functor mean?

Definition of functor : something that performs a function or an operation.

Is functor a Typeclass?

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.

Is maybe a functor Haskell?

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).


1 Answers

It's an instance for Data Parallel Haskell arrays.

like image 77
Tom Savage Avatar answered Oct 20 '22 05:10

Tom Savage