Podchaser Logo
Home
66: Getting Haskell Lesson 21

66: Getting Haskell Lesson 21

Released Thursday, 17th January 2019
Good episode? Give it some love!
66: Getting Haskell Lesson 21

66: Getting Haskell Lesson 21

66: Getting Haskell Lesson 21

66: Getting Haskell Lesson 21

Thursday, 17th January 2019
Good episode? Give it some love!
Rate Episode
Haskell IO Doing the exercises
  • Haskell read, let’s us take a String IO and read out a Double
  • 2 value assignments in the where clause, but got an error til the spacing lined up?

    • unit-4/pizzaCost.hs:15:32: error: parse error on input ‘=’ Perhaps you need a ‘let’ in a ‘do’ block? e.g. ‘let x = 5’ instead of ‘x = 5’
Do Notation
  • a member of the type class Monad

  • Maybe is also a member of Monad

  • I always try to spell pizza with an ‘e’ instead of an ‘a’. lol

  • do-notation as a convenient way to perform IO actions in Haskell

  • It’s important to contextualize this statement with where and when. We are 1/2 half into a getting started book for Haskell. Is this a complete definition of do-notation ? Most certainly not. Is it the most complete, and comprehensive? not likely, remember I’m just getting started, a novice.

    • The point is, when it comes to teaching or conveying your ideas, there is a point of diminishing returns for how much information you give the student.
    • Too little, and they’ll be confused and incomplete
    • Too much, and you’ll overwhelm them, and you guessed it confuse them.
    • Richard Feldman’s Teaching Elm. What you leave out is just as important as what you talk about. What gets the student to their goal directly? NOT what is the most complete and comprehensive explanation. These are fundamentally different goals.
    • Is the goal to get it working? or to understand it on a deeply theoretical level? That will help to guide and weight just how much to give.
Recap
  • IO is a specialized parametrized type

  • It’s purpose is to isolate the messy outside world of Side Effects from the pure reasonable logic of our Haskell program.

  • do-notation allows us to write Haskell as if we weren’t stuck in IO, it’s context contains the side effects for us, and won’t let it escape.

  • Questions Left Open

    • Map.Map Int Double as a Type signature
    • Map.fromList [(1, 20.0), (2, 15.0)] What am I looking at for a return ?
  • I guess we could do an entire episode on Map ?

  • Next up Lazy I/O !!!!

Resources Get Programming With Haskell

Richard’s Elm Conf 2017, Teaching Elm to Beginners

Get Haskell Example Repo

Follow

 

Show More
Rate

Join Podchaser to...

  • Rate podcasts and episodes
  • Follow podcasts and creators
  • Create podcast and episode lists
  • & much more

Episode Tags

Do you host or manage this podcast?
Claim and edit this page to your liking.
,

Unlock more with Podchaser Pro

  • Audience Insights
  • Contact Information
  • Demographics
  • Charts
  • Sponsor History
  • and More!
Pro Features