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 6530293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:44:16+00:00 2026-05-25T09:44:16+00:00

I am learning Haskell and reading the book, Learn You a Haskell for Great

  • 0

I am learning Haskell and reading the book, Learn You a Haskell for Great Good!

When the author talks about where keyword, he says:

In imperative programming languages, you would solve this problem by
storing the result of a computation in a variable. In this section,
you’ll learn how to use Haskell’s where keyword to store the results
of intermediate computations
, which provides similar functionality.

However I saw the where keyword also following at the end of a module declaration, and I doubt the “intermediate computations” explanation in this scenario, what’s the meaning of the where followed at the end of the module declaration?

  • 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-05-25T09:44:17+00:00Added an answer on May 25, 2026 at 9:44 am
    foo = baz
        where
        baz = 1
        quux = 2
        ...
    

    Compare:

    module Foo 
        where
        baz = 1
        quux = 2
        ...
    

    where is acting as a syntactic introducer of a scope of definitions. However, I believe it is just a trick, for we cannot say:

    let baz = 1
        quux = 2
    in module Foo
    

    or

    module Foo
    

    (maybe the latter is legal). I’d like to say that the module declaration exports (unless otherwise specified) all symbols in scope at the point of declaration; that would be the most consistent. But it’s false, so we can consider it at best an idiosyncracy of the concrete syntax. I thought it was weird for a long time too (and upon further reflection answering this question, still do).

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

Sidebar

Related Questions

I have been learning about various functional languages for some time now including Haskell,
I've recently been learning about functional programming (specifically Haskell, but I've gone through tutorials
I'm currently learning Haskell, Which language (F# or Haskell) do you prefer for programming
I have started learning Haskell from Learn You a Haskell . In one of
as a beginner in haskell (learning is tough for my imperative's thinking damaged brain)
I'm just learning Haskell, so sorry if my question is stupid. I'm reading learnyouahaskell.com
I'm interested in learning Haskell on my own time (not through a course), but
As I am learning Haskell, I see that there is a lot of language
I'm trying to broaden my mind by learning Haskell. My self-inflicted homework was to
I am a beginner in Haskell so please bear with me. (Just started learning

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.