Ticket #80 (new defect)
Opened 10 months ago
Improve Data instance
| Reported by: | rl | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Version: | Keywords: | ||
| Cc: |
Description
The current Data instance for vectors doesn't define toConstr and gunfold. This breaks some libraries, most notable uniplate. We should define the Data instance like this:
instance ... => Data (Vector a) where
gunfold k z c
| constrIndex c == 1 = k (z fromList)
| otherwise = error ...
toConstr v = v `seq` vConstr
dataTypeOf _ = vType
vConstr = mkConstr vType "fromList" [] Prefix
vType = mkDataType "Vector" [vConstr]
Note: See
TracTickets for help on using
tickets.
