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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:53:53+00:00 2026-06-07T10:53:53+00:00

When running hlint over the weightDelta function is keeps suggesting Eta reduce. I read

  • 0

When running hlint over the weightDelta function is keeps suggesting Eta reduce. I read another related Eta reduce question, but I can’t seem to transfer the understanding into this case.

module StackQuestion where

import qualified Data.Vector as V

type Weights = V.Vector Double
type LearningRate = Double

weightDelta :: LearningRate -> Double -> Double -> Weights -> Weights
weightDelta n r y ws = V.map update  ws
        where update w = diff * n * w
              diff = r - y

Every change I try to make to “reduce” it to point free syntax just breaks it.
Where’s the change to be made, and is there any sort of intuition or trick to avoid an eta reduce suggestion in the future?

  • 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-07T10:53:54+00:00Added an answer on June 7, 2026 at 10:53 am

    You won’t get it to point- free syntax easily, but what you can do immediately is just η-reduce the ws away.

    weightDelta :: LearningRate -> Double -> Double -> Weights -> Weights
    weightDelta n r y = V.map update
            where update w = diff * n * w
                  diff = r - y
    

    You can also do something like

            where update = (δ *)
                  δ = n * (r - y)
    

    but that’s rather debatable.

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

Sidebar

Related Questions

Running the following code, I get a StackOverflowError at the getPackage() line. How can
I have a question about why some SQL (running on SQL Server 2005) is
Following is one of my application activity xml.Its running fine but the problem was
Running a .jar file in a command line works fine, but i am not
Running into a problem. I have a table defined to hold the values of
-- Running within ASP.NET MVC alongside jQuery -- I'm using jQuery to render a
Running the static analyzer on this piece of code: - (id) readForeignPref { CFPropertyListRef
Running PHP under IIS on my Win XP Pro system. I cannot debug my
Running the following vbscript to call svnadmin dump fails (i.e. no dump is being
Running Mac OS X 10.5.8, with PHP 5.2.11 Pre-installed. Using Coda 1.6.10. I'm writing

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.