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

  • SEARCH
  • Home
  • 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 1113241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:49:41+00:00 2026-05-17T02:49:41+00:00

I was reading a Haskell tutorial (Learn You a Haskell) in which the author

  • 0

I was reading a Haskell tutorial (Learn You a Haskell) in which the author said that laziness goes well with referential transparency. After more reading and some searching, I still don’t understand why. Note that I do understand what’s great about referential transparency and laziness, but it’s them together that’s troubling me.

Is there any special benefit of the combination of the two?

Or maybe the author just wanted to say they’re both nice to have and expressed that ambiguously?

  • 1 1 Answer
  • 1 View
  • 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-05-17T02:49:41+00:00Added an answer on May 17, 2026 at 2:49 am

    It’s really easy. A non-strict (e.g. lazy) evaluation means that tasks can be postponed. But in order to postpone something, you’re better sure that you get later that same result as you would get now, and that’s referential transparency. Consider this imperative Java code:

    long start = System.currentTimeMillis(); //get the start time
    runBenchmarkFunction();
    System.out.println("Run took " + (System.currentTimeMillis() - start) + " ms"); 
    

    Now a lazy language would postpone the evalutation of the first line, because start is only needed in the third line. So the result would be 0 (or very close to it). Probably that isn’t what you want. The reason for that trouble would be that System.currentTimeMillis is not referential transparent. You wouldn’t have any problem in that case if it were a function in the “mathematical sense” like sin or ln, which are referential transparent.

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

Sidebar

Related Questions

Reading Real World Haskell, on page 95 the author provides an example: myFoldl f
I'm reading A Gentle Introduction to Haskell (which is not so gentle) and it
I'm reading through Learn You a Haskell and reached a spot where I'm trying
I was reading Learn You a Haskell's guide on the state monad , but
I just have started to learn Haskell and combine reading books and tutorials with
When I open a file for reading in Haskell, I've found that I can't
I am reading Programming In Haskell, in the 8th chapter, the author gives an
I am reading this tutorial on Haskell . They define function composition as the
After reading this article on writing polyvariadic functions in Haskell , I tried to
Firstly, Real World Haskell , which I am reading, says to never use foldl

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.