Comment

Comment by frank2

Haskell, which uses a HM type system, has a type called Dynamic, which is described as follows:

>Finally, dynamically typed programming in Haskell made easy! Tired of making data types in your Haskell programs just to read and manipulate basic JSON/CSV files? Tired of writing imports? Use dynamic, dynamically typed programming for Haskell! [1]

If using an HM type system is really as easy and as fluid as you suggest, what purpose would be served by a type such as Haskell's Dynamic?

Nor is Dynamic a panacea: to use it requires a lot of extra typing (er, extra keypresses) IIRC, and

>A Dynamic may only represent a monomorphic value; an attempt to create a value of type Dynamic from a polymorphically-typed expression will result in an ambiguity error (see toDyn). [2]

1: https://hackage.haskell.org/package/dynamic

2: https://hackage.haskell.org/package/base-4.14.0.0/docs/Data-...

parent frank2 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton