Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7985127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:28:40+00:00 2026-06-04T11:28:40+00:00

data Ray = Ray Vector Vector or type Ray = (Vector, Vector) Which is

  • 0
data Ray = Ray Vector Vector

or

type Ray = (Vector, Vector)

Which is preferred in idiomatic haskell? Why should I use one over the other?
I don’t care about performance.

It seems to make little difference with functions, e.g.:

trace :: Ray -> …

trace (Ray x d) = …
-- OR
trace (x, d) = …
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:28:41+00:00Added an answer on June 4, 2026 at 11:28 am

    The data version is preferred as it more clearly indicates the intent of the programmer — by creating a new type, you are pointing out to all that this is not merely a tuple, but a meaningful semantic entity, a Ray.

    That then makes it possible to lean on the type system further, with custom instances for Ray, and optimizations not possible in tuples.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a memory pool to store image data in a ray tracer and
Data in question would be mainly text with a one to many relationship (for
I have created one app in iOS5. I want to store and retrive data
Data table structure is: id1,id2,id3,id4,... (some other fields). I want to create summary query
Data: (log_time is a DATETIME type) log_id | action | log_time | user --------------------------------------------------
I've implemented a specialised tree data structure for a ray tracing application. I'm using
data Plane = Plane { point :: Point, normal :: Vector Double } data
I am trying to retrieve data from JTable and then use it to update
data: id bb 1 14,35 2 5,11,12,125,36 3 3,23,45,15,1 4 651 5 5,1,6 6
Data Access Objects (DAOs) are a common design pattern, and recommended by Sun. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.