Getting error in Haskell when running from external file “variable not in scope”Running a compiled Haskell program; getting errorsBeginning Haskell - getting “not in scope: data constructor” errorHow to run a haskell file in interpreted modeHaskell parse error when loading file with list definintionHow to resolve issues when getting error: Not in scopeHaskell error Not in scope: data constructorGetting Source Files to Run in Haskell Programming (WinGHCi)Type synonyms “not in scope” when using Template HaskellError when importing a Haskell moduleGetting “Variable not in scope: w :: Integer” error while defining the type of “w”

California: "For quality assurance, this phone call is being recorded"

Movie where a boy is transported into the future by an alien spaceship

Personalization conditions switching doesn`t work in Experience Editor (9.1.0, Initial Release)

Responsibility for visa checking

Explain Ant-Man's "not it" scene from Avengers: Endgame

Credit card offering 0.5 miles for every cent rounded up. Too good to be true?

Java 8: How to convert String to Map<String,List<String>>?

Is it a problem that pull requests are approved without any comments

Is it legal in the UK for politicians to lie to the public for political gain?

Does any lore text explain why the planes of Acheron, Gehenna, and Carceri are the alignment they are?

Chopin: marche funèbre bar 15 impossible place

Is the decompression of compressed and encrypted data without decryption also theoretically impossible?

How could a possessed body begin to rot and decay while it is still alive?

The term for the person/group a political party aligns themselves with to appear concerned about the general public

Why does the first diminished 7th in this progression not resolve?

Metal bar on DMM PCB

How to split a string in two substrings of same length using bash?

What flavor of zksnark in tezos

Accidentally cashed a check twice

What is the purpose of building foundations?

Pronoun introduced before its antecedent

Do adult Russians normally hand-write Cyrillic as cursive or as block letters?

Does the growth of home value benefit from compound interest?

Did thousands of women die every year due to illegal abortions before Roe v. Wade?



Getting error in Haskell when running from external file “variable not in scope”


Running a compiled Haskell program; getting errorsBeginning Haskell - getting “not in scope: data constructor” errorHow to run a haskell file in interpreted modeHaskell parse error when loading file with list definintionHow to resolve issues when getting error: Not in scopeHaskell error Not in scope: data constructorGetting Source Files to Run in Haskell Programming (WinGHCi)Type synonyms “not in scope” when using Template HaskellError when importing a Haskell moduleGetting “Variable not in scope: w :: Integer” error while defining the type of “w”






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-1















The problem I am facing is running from an external file
But I am getting the error "Variable not in scope"



I am running on windows and its the most basic program. When I am trying to do this fully by command prompt it is working fine. But when I am trying to do this from an external file it is giving this error



file name: haskell_trial.hs



doubleMe x = x + x 


While running this is the error:



Prelude> :l haskell_trial
[1 of 1] Compiling Main ( haskell_trial.hs, interpreted )
Ok, one module loaded.
*Main> doubleMe 5

<interactive>:6:1: error:
Variable not in scope: doubleMe :: Integer -> t



This is what i get when i simply do it from command prompt:



Prelude> doubleme x = x+x
Prelude> doubleme 9
18









share|improve this question



















  • 4





    are you sure that you have it as doubleMe in the file, and not doubleme? Haskell is case sensitive.

    – Robin Zigmond
    Mar 24 at 13:22











  • yep its as doubleMe

    – Amrita Deb
    Mar 27 at 10:48











  • well something is up, because this should definitely work. Can you edit your question to show the complete contents of haskell_trial.hs

    – Robin Zigmond
    Mar 27 at 10:50











  • there is just one line there doubleMe x = x + x

    – Amrita Deb
    Mar 28 at 11:18












  • I'm sorry to keep repeating myself, but we need to see an exact replica of 1) the file you're loading and 2) your GHCi session. Everything you have said you have done should lead to the function working as expected with no error, so something must be amiss somewhere - until I see the exact details of what you've done I can't guess as to what. We're really into trivial troubleshooting here, like are you definitely loading the correct file (and not a different Haskell file without this function in it)?

    – Robin Zigmond
    Mar 28 at 11:23

















-1















The problem I am facing is running from an external file
But I am getting the error "Variable not in scope"



I am running on windows and its the most basic program. When I am trying to do this fully by command prompt it is working fine. But when I am trying to do this from an external file it is giving this error



file name: haskell_trial.hs



doubleMe x = x + x 


While running this is the error:



Prelude> :l haskell_trial
[1 of 1] Compiling Main ( haskell_trial.hs, interpreted )
Ok, one module loaded.
*Main> doubleMe 5

<interactive>:6:1: error:
Variable not in scope: doubleMe :: Integer -> t



This is what i get when i simply do it from command prompt:



Prelude> doubleme x = x+x
Prelude> doubleme 9
18









share|improve this question



















  • 4





    are you sure that you have it as doubleMe in the file, and not doubleme? Haskell is case sensitive.

    – Robin Zigmond
    Mar 24 at 13:22











  • yep its as doubleMe

    – Amrita Deb
    Mar 27 at 10:48











  • well something is up, because this should definitely work. Can you edit your question to show the complete contents of haskell_trial.hs

    – Robin Zigmond
    Mar 27 at 10:50











  • there is just one line there doubleMe x = x + x

    – Amrita Deb
    Mar 28 at 11:18












  • I'm sorry to keep repeating myself, but we need to see an exact replica of 1) the file you're loading and 2) your GHCi session. Everything you have said you have done should lead to the function working as expected with no error, so something must be amiss somewhere - until I see the exact details of what you've done I can't guess as to what. We're really into trivial troubleshooting here, like are you definitely loading the correct file (and not a different Haskell file without this function in it)?

    – Robin Zigmond
    Mar 28 at 11:23













-1












-1








-1








The problem I am facing is running from an external file
But I am getting the error "Variable not in scope"



I am running on windows and its the most basic program. When I am trying to do this fully by command prompt it is working fine. But when I am trying to do this from an external file it is giving this error



file name: haskell_trial.hs



doubleMe x = x + x 


While running this is the error:



Prelude> :l haskell_trial
[1 of 1] Compiling Main ( haskell_trial.hs, interpreted )
Ok, one module loaded.
*Main> doubleMe 5

<interactive>:6:1: error:
Variable not in scope: doubleMe :: Integer -> t



This is what i get when i simply do it from command prompt:



Prelude> doubleme x = x+x
Prelude> doubleme 9
18









share|improve this question
















The problem I am facing is running from an external file
But I am getting the error "Variable not in scope"



I am running on windows and its the most basic program. When I am trying to do this fully by command prompt it is working fine. But when I am trying to do this from an external file it is giving this error



file name: haskell_trial.hs



doubleMe x = x + x 


While running this is the error:



Prelude> :l haskell_trial
[1 of 1] Compiling Main ( haskell_trial.hs, interpreted )
Ok, one module loaded.
*Main> doubleMe 5

<interactive>:6:1: error:
Variable not in scope: doubleMe :: Integer -> t



This is what i get when i simply do it from command prompt:



Prelude> doubleme x = x+x
Prelude> doubleme 9
18






haskell






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 18:33









Michael Litchard

2,00321844




2,00321844










asked Mar 24 at 13:19









Amrita DebAmrita Deb

38118




38118







  • 4





    are you sure that you have it as doubleMe in the file, and not doubleme? Haskell is case sensitive.

    – Robin Zigmond
    Mar 24 at 13:22











  • yep its as doubleMe

    – Amrita Deb
    Mar 27 at 10:48











  • well something is up, because this should definitely work. Can you edit your question to show the complete contents of haskell_trial.hs

    – Robin Zigmond
    Mar 27 at 10:50











  • there is just one line there doubleMe x = x + x

    – Amrita Deb
    Mar 28 at 11:18












  • I'm sorry to keep repeating myself, but we need to see an exact replica of 1) the file you're loading and 2) your GHCi session. Everything you have said you have done should lead to the function working as expected with no error, so something must be amiss somewhere - until I see the exact details of what you've done I can't guess as to what. We're really into trivial troubleshooting here, like are you definitely loading the correct file (and not a different Haskell file without this function in it)?

    – Robin Zigmond
    Mar 28 at 11:23












  • 4





    are you sure that you have it as doubleMe in the file, and not doubleme? Haskell is case sensitive.

    – Robin Zigmond
    Mar 24 at 13:22











  • yep its as doubleMe

    – Amrita Deb
    Mar 27 at 10:48











  • well something is up, because this should definitely work. Can you edit your question to show the complete contents of haskell_trial.hs

    – Robin Zigmond
    Mar 27 at 10:50











  • there is just one line there doubleMe x = x + x

    – Amrita Deb
    Mar 28 at 11:18












  • I'm sorry to keep repeating myself, but we need to see an exact replica of 1) the file you're loading and 2) your GHCi session. Everything you have said you have done should lead to the function working as expected with no error, so something must be amiss somewhere - until I see the exact details of what you've done I can't guess as to what. We're really into trivial troubleshooting here, like are you definitely loading the correct file (and not a different Haskell file without this function in it)?

    – Robin Zigmond
    Mar 28 at 11:23







4




4





are you sure that you have it as doubleMe in the file, and not doubleme? Haskell is case sensitive.

– Robin Zigmond
Mar 24 at 13:22





are you sure that you have it as doubleMe in the file, and not doubleme? Haskell is case sensitive.

– Robin Zigmond
Mar 24 at 13:22













yep its as doubleMe

– Amrita Deb
Mar 27 at 10:48





yep its as doubleMe

– Amrita Deb
Mar 27 at 10:48













well something is up, because this should definitely work. Can you edit your question to show the complete contents of haskell_trial.hs

– Robin Zigmond
Mar 27 at 10:50





well something is up, because this should definitely work. Can you edit your question to show the complete contents of haskell_trial.hs

– Robin Zigmond
Mar 27 at 10:50













there is just one line there doubleMe x = x + x

– Amrita Deb
Mar 28 at 11:18






there is just one line there doubleMe x = x + x

– Amrita Deb
Mar 28 at 11:18














I'm sorry to keep repeating myself, but we need to see an exact replica of 1) the file you're loading and 2) your GHCi session. Everything you have said you have done should lead to the function working as expected with no error, so something must be amiss somewhere - until I see the exact details of what you've done I can't guess as to what. We're really into trivial troubleshooting here, like are you definitely loading the correct file (and not a different Haskell file without this function in it)?

– Robin Zigmond
Mar 28 at 11:23





I'm sorry to keep repeating myself, but we need to see an exact replica of 1) the file you're loading and 2) your GHCi session. Everything you have said you have done should lead to the function working as expected with no error, so something must be amiss somewhere - until I see the exact details of what you've done I can't guess as to what. We're really into trivial troubleshooting here, like are you definitely loading the correct file (and not a different Haskell file without this function in it)?

– Robin Zigmond
Mar 28 at 11:23












1 Answer
1






active

oldest

votes


















0














It was some setup issue. I installed again and it started working fine






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324212%2fgetting-error-in-haskell-when-running-from-external-file-variable-not-in-scope%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    It was some setup issue. I installed again and it started working fine






    share|improve this answer



























      0














      It was some setup issue. I installed again and it started working fine






      share|improve this answer

























        0












        0








        0







        It was some setup issue. I installed again and it started working fine






        share|improve this answer













        It was some setup issue. I installed again and it started working fine







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 12 at 17:11









        Amrita DebAmrita Deb

        38118




        38118





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324212%2fgetting-error-in-haskell-when-running-from-external-file-variable-not-in-scope%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript