Domain Modelling with Haskell: Data Structures

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ต.ค. 2024

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

  • @badeducation6041
    @badeducation6041 5 ปีที่แล้ว +11

    For anyone having trouble with the Monoid instance, things have changed with Monoids & Semigroups in base since 4.11.
    You can try changing the "instance Monoid Report where" section to:
    instance Semigroup Report where
    (Report b1 a1 d1) (Report b2 a2 d2) =
    Report (b1 + b2) (a1 + a2) (d1 + d2)
    instance Monoid Report where
    mempty = Report 0 0 0

  • @web3tel
    @web3tel 6 ปีที่แล้ว +13

    Great presentation, please keep it coming

  • @2Cerealbox
    @2Cerealbox 6 ปีที่แล้ว +6

    The intro sounds like a Law & Order intro. So serious!

    • @HaskellatWork
      @HaskellatWork  6 ปีที่แล้ว +9

      Haskell is law and order. Haskell is serious. :)

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

    Font is Iosevka Term AFAIK if anyone's wondering, beautiful

  • @kevinkamau
    @kevinkamau 6 ปีที่แล้ว

    Thank you for the video series. Keep on doing the awesome work.

  • @HaskellatWork
    @HaskellatWork  6 ปีที่แล้ว +12

    Missing from the video voice-over, but included in the show notes, is this disclaimer which I want to stress: "The use of Double for modelling money is not well-suited for real systems, and should be replaced with a proper arbitrary-precision data type, e.g. Scientific. In the spirit of keeping down the scope of this tutorial Double was still used."

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

      I was just going to quibble! (Maybe add a text box annotation over the video?)

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

      Vilem-Benjamin Liepelt TH-cam doesn't support it anymore :/

    • @VilemBenjaminLiepelt
      @VilemBenjaminLiepelt 6 ปีที่แล้ว

      Oh noes, what a drag. Never mind, it's great as it is.

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

    Great presentation with a good example. Thank you!

    • @abbastolgayylmaz4078
      @abbastolgayylmaz4078 6 ปีที่แล้ว

      Got an error for the Money type.
      No instance for (Eq Money)
      gist.github.com/streamerd/f24e5b91b687361e88363f11aa9ef591
      code I am using:
      gist.github.com/streamerd/0de4b16b2c9b308914d09e892d61fa7a

  • @mecusorin
    @mecusorin 5 ปีที่แล้ว

    Thanks for the effort! Can't wait to watch the next one :)

  • @DesonteJolivet
    @DesonteJolivet 6 ปีที่แล้ว

    Great video. You have a new fan, keep it coming.

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

    Can you make a video on you editor configuration? They would be a better way for some to start over.

  • @tahamagdy4932
    @tahamagdy4932 6 ปีที่แล้ว

    Please, give us more of those videos.

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

    Superb content!

  • @sergeibatiuk3468
    @sergeibatiuk3468 8 หลายเดือนก่อน

    How do you deal with repeating field names accross the data definitions? Eg a Person can have a name, so can an Animal

    • @sergeibatiuk3468
      @sergeibatiuk3468 8 หลายเดือนก่อน

      Haskell would normally not let me compile this

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

    Woah! How do you open REPL from Vim?

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

      In this video I was using intero-neovim, which integrates the intero/GHCi REPL with Neovim .

  • @MattyWilliams
    @MattyWilliams 6 ปีที่แล้ว

    At 1:59 and 9:53 you format the layout automatically. How are you doing this?

    • @HaskellatWork
      @HaskellatWork  6 ปีที่แล้ว

      I'm using hindent through Neoformat. More info in the FAQ: haskell-at-work.com/about.html#what-editor-are-you-using

  • @dibyojyotibhattacharjee5349
    @dibyojyotibhattacharjee5349 4 ปีที่แล้ว

    What is your font?

  • @kojandevelopment
    @kojandevelopment 6 ปีที่แล้ว +2

    What the theme of you text editor?

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

      KDeveloper vim-one: github.com/rakr/vim-one

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

    Is this vim?

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

    Do people often write concrete types and then refactor to more polymorphic versions in Haskell programming, like what you have shown in your tutorials?

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

      Haskell Type I can't answer for people in general, but I often do just that. I might write a specialized function, see what type GHC infers, and then use that. Things like functors and traversable might require some more experience to identify on your own, but you'll see the patterns once you start working with these things regularly.

  • @chriswaggoner4691
    @chriswaggoner4691 6 ปีที่แล้ว +2

    What does `Money` do that regular numbers couldn’t do? How is doing this with types different (better, hopefully) than doing it with objects?
    What does [stockholm, gothenburg, malmø] accomplish? It looks like you just type the same word with different "", [], and capitalization in various places.
    Sorry, I find this confusing.

  • @MrOboema
    @MrOboema 2 ปีที่แล้ว

    When you spend years to perfect writing readable code....
    you read this:
    "newType Money = Money
    { unMoney :: Double
    } deriving {Show, Eq, Num}"
    Money = Money eh? Very profound...Nah. This is unreadable garbage.
    Hehe...even IT-nerds think those math kids are weird eh?

    • @myxail0
      @myxail0 ปีที่แล้ว

      left Money is a type name, right Money is a ctor name. If you are this supposed proper "IT nerd" maybe the following example of C++ "using iipair = pair;" would put you off too?