Fork me on GitHub
#other-languages
<
2017-11-01
>
ghadi19:11:20

if types aren't sufficient, have you tried adding more types?

seancorfield19:11:42

That Front Row article made my blood boil -- it gets the semantics of Clojure completely wrong so it's not any sort of "rewrite Clojure in Haskell". It's a ridiculous article.

tbaldridge20:11:43

And funny enough it's a perfect example of what both Rich and Eric were talking about:

tbaldridge20:11:17

1) it's a "fun" puzzle with little gained in the end

tbaldridge20:11:51

2) a whole lot of words to describe something that could be done, but no one has actually done it

tbaldridge20:11:07

And yeah, even then it misses out on runtime polymorphic extension so it's still wrong.

tbaldridge20:11:37

Because they built it all with pattern matching which is exactly what Rich pointed out as a flaw

roberto20:11:00

It is not about the semantics of clojure, it is trying to show that you can also parse inputs that don’t have a strictly defined schema.

tbaldridge20:11:31

eh, but you can't really

roberto20:11:39

The author probably didn’t communicate that clearly, I can see how the wrong message can be inferred from it.

tbaldridge20:11:16

What you get out is a dynamically typed structure, and then you have to somehow map that to internal static types. Which means you just build an informal, bug ridden, .... implementation of lisp, in Haskell 😛

tbaldridge20:11:48

Not to mention that that example doesn't really work either, since true EDN parsers must support data readers. So you have to handle extension at runtime, where something like #inst "2012-01-02" needs to be a physical date object (not a tagged or wrapped value). No way to type that at compile time. So you're left writing a dynamic type system for haskell.

seancorfield20:11:36

It also ignores the transducer-returning arity of map -- which Haskellers have previously failed to write correct types for (I seem to recall Rich specifically calling out that transducers cannot be fully typed in Haskell?).

seancorfield20:11:46

It basically ignores anything and everything that would show the (obvious) holes in his argument. Sorry, it's making me angry/frustrated again just re-reading it...

seancorfield20:11:23

(and he doesn't even have a comment system so I can vent on his blog about how wrong he is! 🙂 )

cfleming21:11:07

You can vent in at least 4 places on reddit 🙂

seancorfield22:11:00

I try not to venture into Reddit. Too many "opinions" and it's a giant ol' time sink...

dpsutton21:11:06

i'd also like to read a blog that makes some examples a little more concrete if you were interested in typing some thoughts up

tbaldridge22:11:05

@seancorfield is right, the thing that I haven't seen fully explored (or solved) in Haskell is that transducers create a sort of state-machine.

tbaldridge22:11:28

Imagine if you tried:

tbaldridge22:11:39

actually I don't even know how to type that. but you can imagine a reduce over a typed map. Where some keys are known to have integer values, but others are known to have string values.

tbaldridge22:11:13

A correctly typed transducer should be able to catch errors with that at compile time.

hiredman22:11:13

that rings hollow to me

hiredman22:11:40

function composition is very type-able, and that is what a transducer is

hiredman22:11:48

or I should say building a transducer is function composition, and a transducer is just a function from a step function to a step function, and those are also known to exist in typed languages