Ticket #57 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Problem when nesting unboxed vectors in user defined data structures with newtype

Reported by: kaffeepause73 Owned by:
Priority: trivial Milestone:
Version: Keywords: newtype negate show
Cc:

Description

when nesting a unboxed vector object in a user defined data structure with newtype using a touple, the show command throws an exception -- but only after an negate command on the user defined data type

Commented code with build and output log and executable in bz2 archive.

Attachments

output.log (458 bytes) - added by kaffeepause73 2 years ago.
output.2.log (458 bytes) - added by kaffeepause73 2 years ago.
compile.log (5.8 kB) - added by kaffeepause73 2 years ago.
vectorNegateShowBugwithUserDefinedDatatypes.hs (2.4 kB) - added by kaffeepause73 2 years ago.
vectorNegateShowBugwithUserDefinedDatatypes.hi (1.4 kB) - added by kaffeepause73 2 years ago.
vectorNegateShowBugwithUserDefinedDatatypes.o (14.1 kB) - added by kaffeepause73 2 years ago.

Change History

Changed 2 years ago by kaffeepause73

Changed 2 years ago by kaffeepause73

Changed 2 years ago by kaffeepause73

Changed 2 years ago by kaffeepause73

Changed 2 years ago by kaffeepause73

Changed 2 years ago by kaffeepause73

follow-up: ↓ 2   Changed 2 years ago by rl

Hmm, I'm not convinced this is a problem with vector. Rather, this looks like the culprit to me:

smap f s1 fstr =  Signal (n,t,v,u)
               where 
                 n = getName s1
                 t = getTime s1
                 vdata = getVect s1
                 u = getUnit s1
                 v = V.map f v -- when time data is same

The last line is the what leads to non-termination. Should it be v = V.map f vdata? If not, what behaviour do you expect?

in reply to: ↑ 1   Changed 2 years ago by kaffeepause73

  • priority changed from major to trivial
  • status changed from new to closed
  • resolution set to fixed

Yes - sorry You are right.

I created an unintended loop (short variable names are nice but dangerous). Sorry for the hassle and thanks for the quick response.

Cheers Phil

Note: See TracTickets for help on using tickets.