Artwork

Content provided by Mark Derricutt, Greg Amer, and Richard Vowles. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Mark Derricutt, Greg Amer, and Richard Vowles or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Player FM - Podcast App
Go offline with the Player FM app!

Episode 116 - Messy Types and Garbage Collection

1:58:34
 
Share
 

Manage episode 41463837 series 8373
Content provided by Mark Derricutt, Greg Amer, and Richard Vowles. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Mark Derricutt, Greg Amer, and Richard Vowles or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
  • Garbage Collection
  • Language/Compiler design
  • Function Types
    • A discussion on whether a functions signature is a type, or not.

During this discussion we talked about the implicit currying of haskell functions and how this could lead to run-time errors rather than compile errors, however whilst I (Mark) knew what I was talking about, I missed a fundamental part of the equation - function types include the return type, so a partially applied function that doesn’t fit a high-order function is a compile time error.

So given two functions:

someHof :: (String -> String) -> String take3StringsReturningString :: String -> String -> String -> String

The first function someHof takes a function String -> String and returns a String, if we partially apply take3StringsReturningString "test" the resulting function is String -> String -> String which doesn’t match the required syntax of someHof so wouldn’t even compile.

  continue reading

100 episodes

Artwork
iconShare
 
Manage episode 41463837 series 8373
Content provided by Mark Derricutt, Greg Amer, and Richard Vowles. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Mark Derricutt, Greg Amer, and Richard Vowles or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
  • Garbage Collection
  • Language/Compiler design
  • Function Types
    • A discussion on whether a functions signature is a type, or not.

During this discussion we talked about the implicit currying of haskell functions and how this could lead to run-time errors rather than compile errors, however whilst I (Mark) knew what I was talking about, I missed a fundamental part of the equation - function types include the return type, so a partially applied function that doesn’t fit a high-order function is a compile time error.

So given two functions:

someHof :: (String -> String) -> String take3StringsReturningString :: String -> String -> String -> String

The first function someHof takes a function String -> String and returns a String, if we partially apply take3StringsReturningString "test" the resulting function is String -> String -> String which doesn’t match the required syntax of someHof so wouldn’t even compile.

  continue reading

100 episodes

Alle afleveringen

×
 
Loading …

Welcome to Player FM!

Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.

 

Quick Reference Guide