# Ticket #20 (new defect)

Opened 7 years ago

## Functor instance for Reactive has an error.

Reported by: | camio | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | |

Version: | Keywords: | ||

Cc: |

### Description

The current definition:

instance Functor (ReactiveG t) where fmap f ~(a `Stepper` e) = f a `stepper` fmap f e

A reduction for `fmap id _|_`.

fmap id _|_ stepper (id (case _|_ of (Stepper a _) -> a)) (fmap id (case _|_ of (Stepper _ b -> b))) Stepper (id (case _|_ of (Stepper a _) -> a)) (fmap id (case _|_ of (Stepper _ b -> b))) Stepper (id _|_) (fmap id (case _|_ of (Stepper _ b -> b))) Stepper _|_ (fmap id (case _|_ of (Stepper _ b -> b)))

We use http://www.haskell.org/onlinereport/exps.html#sect3.17.3 for the lazy pattern matching.

In section 6.3.5 we have the law for functors that fmap id = id, so

`fmap id _|_ == Stepper _|_ (fmap id (case _|_ of (Stepper _ b -> b))) /= _|_ == id _|_`

The solution is to remove the ~ from the definition.

**Note:**See TracTickets for help on using tickets.