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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:37:28+00:00 2026-06-01T09:37:28+00:00

Hugs seems to have a problem with several non-enbraced !! in a partial application.

  • 0

Hugs seems to have a problem with several non-enbraced !! in a partial application.

While this works fine in GHCi:

([[0]]!!0!!)0

Hugs reports a syntax error for the ).

Is this a bug in Hugs?

Adding an extra brace for the second list index operator works though:

(([[0]]!!)0!!)0

or

(([[0]]!!0)!!)0
  • 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-01T09:37:29+00:00Added an answer on June 1, 2026 at 9:37 am

    This is a known issue in Hugs. From the Hugs 98 Users Guide section on Expressions:

    In Hugs, the expression must be an fexp (or case or do). Legal expressions like (a+b+) and (a*b+) are rejected.

    Digression Alert

    Maybe this is what FUZxxl was talking about in his comment?

    Try defining your own (!!) function in ghc and set it to have right-associative fixity:

    import Prelude hiding ((!!))
    infixr 5 !! -- infixr will make it right associative
    (!!) a b = head . drop b $ a
    

    Now that line won’t work in ghci either!

    ghci> :t ([[0]] !! 0 !!)
    
    <interactive>:1:1:
        The operator `!!' [infixr 5] of a section
            must have lower precedence than that of the operand,
              namely `!!' [infixr 5]
            in the section: `[[0]] !! 0 !!'
    

    Because (!!) has been set with infixr and is now right-associative. If you use infixl, that line works fine.

    This is a completely separate issue from the question you asked though. This is about left vs right associativity, whereas the problem with Hugs is that it just doesn’t parse an expression like (a+b+).

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

Sidebar

Related Questions

i have a question regarding this Haskell code: module Queue (Queue, emptyQueue, queueEmpty, enqueue,
There are differences between Hugs, Yhc and GHCi? If there are differences, What are
I'm new to Haskell, so am sorry if this is incredibly obvious... I have
I'm new to functional programming. I have a basic question. I'm using the Hugs
Look at the problem: Normally, in the interactive Haskell environment, non-Latin Unicode characters (that
What are the usual causes of Error C stack overflow in the Hugs Haskell
I have a model called HeroStatus with the following attributes: id user_id recordable_type hero_type
(Please forgive me in advance for any formatting errors, as this is the first
Given this: data Foo = Bar { name :: String } | Baz {
Hugs> 94535^445 1376320882321377050696053887661515621104890164005282153069726424773999801846841903244827702943487982707454966009456016735041878000604143500908532887464920380605164932112687039059526672109818924234920844448231612532570718657160234177285377733830104834041049076609912488237219608445995072867798430614935403219495883835042862802917980856774134757390782052200512932375660858045003581611863121089979673784484701791210379500218604466721285456487387736825167702127154268533859979529612671925052419513844416493584817268143587955662039327860394141299238613042312035808541735213479394437496215520277526351425482512084759462579494878772787079101513841720202004639843443083454387175700954018825292148776647553122504118229978165851660083576570848983047255050145168802863168613110619584686348869690774233051669081248424584219383477237544209892290799448207462345346336076966775224683516220960618177284844330167142846351091001423033864986042919757795382577032341453971393897073354841924116635150129850119992031076354249371062307034564093077675129303383786693131843907104175619570678630497198824622804914508555467550904967368926176118094672479099827962889569753303773699017596074205893197641101210911874606040804983166177455705972192827752532495287749766682029353154226049380290040508900715169403153139668217790502306177709467234413947747673881158973344492079455405942662489751581189327200960698310350121179918845099840977270519116578719881752429190273998774113278822810866144521416958558406602325070095207349450759264393913367193083149679216066539911941983836313340998945139132421885688290888674594474605510238217590823316979504437667252929278291853368754482552573193289277120902144178425726693671235675042499401282016643202758246845332593475338220708351934511933096882598943512036679145593929114103343255708217768511665236173107020739195152050863630870948954052925049746246549772984384435109578859863612603574306739909728739428192798727373799081111333186135697868385292787575475482883660605162944306327057220313320376280182432763977906971557137715710757099478269250731209785404487629107297262798803645379809868663503452656912571816192881412782623078761411808958183665272686617730596943579533808499348879195167683064937591552734375 Why can Haskell calculate such a large number, and other languages,

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.