Learning Haskell Week02 - Intro To Functions

Learning Haskell for absolute beginners! This week we will be tackling how to create and use functions.
As always, accompanying slides will be hosted at
www.cas.mcmaster.ca/~dalvescb

Пікірлер: 24

  • @limboski-o5n
    @limboski-o5n2 жыл бұрын

    Well, the Haskelly extension button "Load GHCi" fails for me due to the "--ghci-options" command line option with the command: "stack ghci --ghci-options Lib.hs". I get the following error message: : error: can't find file: Lib.hs Failed, no modules loaded. The problem seems to be that even though "Load GHCi" tells powershell to change the directory to the "src" directory in the powershell (cd "j:\bobhaskell\bobtest\src) , the "current working directory in Ghci shows it to be one level up in the project directory (J:\bobhaskell\bobtest ) when using "--ghci-options." Any ideas on why Load GHCi is failing?

  • @jesusmtz29
    @jesusmtz292 жыл бұрын

    That where feature is so nice and clean

  • @Andrew-Galvin
    @Andrew-Galvin3 жыл бұрын

    Hey Curtis, when I type double x = x + x I don’t get the purple line above it I have all the extensions I don’t know why this is happening any help would be nice:)

  • @andrewganssle9415
    @andrewganssle94153 жыл бұрын

    Hey how do I open visual studios and get a completely new template. Every time I open it I am still in src/Lib.hs from the last video. Even when I hit new template it still has me in that file and everything? Probably a dumb question but this is my first programming ever. Also I'm really excited to go on this journey with you and cannot thank you enough for your time and efforts!

  • @andrewganssle9415

    @andrewganssle9415

    3 жыл бұрын

    Also, are there answers to the resources?

  • @my_parents_mistake
    @my_parents_mistake3 жыл бұрын

    Does this tutorial need to be watched before the second live tutorial or first live tutorial on week 3

  • @CurtisDAlves

    @CurtisDAlves

    3 жыл бұрын

    Yes I recommend watching this before the Week02 video on Types (I mention that at the beginning) and definitely before any of the Week03 videos

  • @HamzaKhan-ho4jw

    @HamzaKhan-ho4jw

    2 жыл бұрын

    @@CurtisDAlves when i runs the code and if it had an error the terminal goes to prelude unlike your one which stays in the lib

  • @davidbanigo9198
    @davidbanigo91983 жыл бұрын

    Might seem like a silly comment but is there any way I can learn the different instructions for every function, because sometimes you start keying in something and I am so lost basically cause I have no previous knowledge on haskell language.

  • @CurtisDAlves

    @CurtisDAlves

    3 жыл бұрын

    The idea for the prelude functions is it’s pretty straight forward to figure out what it does by looking at its name and type, but you can also check the documentation on hackage hackage.haskell.org/package/base-4.14.0.0/docs/Prelude.html

  • @HamzaKhan-ho4jw
    @HamzaKhan-ho4jw2 жыл бұрын

    i followed you step by step but my vs code says Project requires GHC but it isn't installed. i installed it but it has this issue. also when i in new terminal tries stack it gives some error

  • @Carliyke

    @Carliyke

    Жыл бұрын

    From what O.S. are you running ghci?

  • @nitusah1985
    @nitusah1985 Жыл бұрын

    :8:2: warning: [-Wtype-defaults] * Defaulting the following constraints to type `Integer' (Show a0) arising from a use of `print' at :8:2-14 (Num a0) arising from a use of `it' at :8:2-14 (Enum a0) arising from a use of `it' at :8:2-14 * In a stmt of an interactive GHCi command: print it 6 *Lib> factorial 3 why this error is showing? Can anyone help me, please??

  • @viktorturchenko5336
    @viktorturchenko53363 жыл бұрын

    Hi, where are the exercises you mentioned in the end of the video?

  • @viktorturchenko5336

    @viktorturchenko5336

    3 жыл бұрын

    oops I'm sorry, I found them

  • @CurtisDAlves

    @CurtisDAlves

    3 жыл бұрын

    @@viktorturchenko5336 for anyone looking it it's in the description, www.cas.mcmaster.ca/~dalvescb

  • @jannik2307
    @jannik23073 жыл бұрын

    How can I add load GHCi to the status bar ?

  • @CurtisDAlves

    @CurtisDAlves

    3 жыл бұрын

    If the GHCi button doesn't appear in the status bar, make sure stack is installed, make sure the Haskelly (yes Haskelly with a y) extension is installed, make sure you have a stack project folder open and currently have a haskell file open, and try building the project manually from terminal like I show you in the video at least once (i.e open terminal, make sure you are cd'd into the right directory, and enter stack build)

  • @jannik2307

    @jannik2307

    3 жыл бұрын

    @@CurtisDAlves Haskelly wasn‘t installed. Thank you

  • @amrthabi7
    @amrthabi73 жыл бұрын

    Did you just recommend spaces over tabs??? Why would you say something so controversial yet so brave?

  • @ahmedabbas9103

    @ahmedabbas9103

    3 жыл бұрын

    Tabs >>>

  • @ABHISHEKSINGH-nv1se

    @ABHISHEKSINGH-nv1se

    3 жыл бұрын

    Yes... because Haskell recommends spaces over tabs.

  • @ABHISHEKSINGH-nv1se

    @ABHISHEKSINGH-nv1se

    3 жыл бұрын

    I wrote using tabs but then haskell complains that you have used tabs.