Haskell for Imperative Programmers #22 - Either

แชร์
ฝัง

ความคิดเห็น • 19

  • @kaa1el960
    @kaa1el960 3 ปีที่แล้ว +3

    The existence of either shows Either a b is exactly the coproduct object in the category of types

  • @ramson111
    @ramson111 4 ปีที่แล้ว +5

    Great tutorials so far! It would be really great if you could continue until you talk about Monads ...

    • @philipphagenlocher
      @philipphagenlocher  4 ปีที่แล้ว +2

      Thank you! I already did a video on Monads: th-cam.com/video/IBB7JpbClo8/w-d-xo.html

  • @thepuzzlemaker2159
    @thepuzzlemaker2159 4 ปีที่แล้ว +7

    You should talk about using third-party libraries with Cabal/stack and/or compiling with GHC into a binary rather than interpreting with GHCi

    • @thepuzzlemaker2159
      @thepuzzlemaker2159 4 ปีที่แล้ว +1

      I’d also like to see some info on making your own Haskell modules

    • @philipphagenlocher
      @philipphagenlocher  4 ปีที่แล้ว +3

      @@thepuzzlemaker2159 Thank you for the suggestions! Compilation and defining modules are great topics! Stay tuned! ;)

    • @chop098
      @chop098 3 ปีที่แล้ว +1

      .

  • @bashful228
    @bashful228 ปีที่แล้ว +1

    I would like to see something about FP data structures and code design patterns for real world applications. I am still novice at Haskell but really struggle to think about how to construct any kind of useful code. How do you go about solving some simple problems, maybe start with simple text and number based games.

  • @elhusseinali8934
    @elhusseinali8934 4 ปีที่แล้ว +7

    thanks for your efforts, can you talk about the concurrency in Haskell?

    • @philipphagenlocher
      @philipphagenlocher  4 ปีที่แล้ว +6

      Very interesting topic! I will probably make one or two videos about it. :)

    • @haydencole6129
      @haydencole6129 3 ปีที่แล้ว

      @Keegan Karsyn definitely, been watching on flixzone for months myself :)

    • @blazetaylor367
      @blazetaylor367 3 ปีที่แล้ว

      @Keegan Karsyn yea, I've been using flixzone for months myself =)

  • @CaptainWumbo
    @CaptainWumbo 3 ปีที่แล้ว +4

    Really like this series, thanks for making so many well thought out videos.
    My idea, maybe it's not right for you, is how to make haskell feel batteries included for scripting or certain common usecases. eg what are the can't live without libraries that stop you from reinventing the wheel, save you working at a very low level when your problem is high level. The underscore js and jquery of haskell, if you will (sorry both those libs are probably dated). I want to use haskell as a quick and dirty scripting language like I can ruby, but although I'm getting better at haskell I sometimes waste time writing splitBy or some other function. I know there's libs for this stuff, but I don't know which ones are beloved.

    • @0LoneTech
      @0LoneTech 4 หลายเดือนก่อน

      What you need is a fairly personal thing, but many have had this thought before. For instance Rebase.Prelude or Foundation could cover quite a lot.
      I have personally used Relude.

  • @Abu3.1415
    @Abu3.1415 4 ปีที่แล้ว

    Can you make videos on Socket programming in Haskell?.

    • @0LoneTech
      @0LoneTech 4 หลายเดือนก่อน

      You'd want a separate library for that, e.g. tcp-streams, network-simple, streamly or conduit-extra.

  • @Sydra.
    @Sydra. 3 ปีที่แล้ว +2

    Huh! I would never use this. "Left" and "Right" has no contextual meaning. It would create unreadable code. Checking with actual type name is much more preferable.

    • @Karlthegreat100
      @Karlthegreat100 3 ปีที่แล้ว +10

      I also started with Haskell not using this. But after programming in Rust for awhile, which has data type names that makes much more sense (like Option for Maybe and Result for Either), I also started using it for Haskell. Takes some getting used to, I guess.

    • @perekman3570
      @perekman3570 5 หลายเดือนก่อน

      The context is the placement of the arguments in the _either_ function, something you would otherwise have to remember and could easily be switched around.