mrkeen

joined 1 year ago
[–] [email protected] 0 points 7 months ago (1 children)

@Windex007
> You as the writer, you don’t know either?
Not until the compiler tells me.

> Or is the argument that nobody but the compiler and god need know? That having an awareness of the types has no value?
No, I want to know, because knowing the types has value. If the compiler has inference, it can tell me, if not, it can't.

[–] [email protected] 0 points 7 months ago (3 children)

@Windex007

lexer :: Parser LexState (Vector Int, Vector Token)
lexer = do
(positions, tokens) <- _ nextPositionedToken
...

What goes where the underscore is in the above snippet?

[–] [email protected] 2 points 7 months ago (5 children)

@Windex007 @snowe

Yes. Type-inference typically *knows better than me* what the types should be.

I frequently ask the compiler what code I need to write next by leaving a gap in my implementation and letting the compiler spit out the type of the missing section.

[–] [email protected] 3 points 7 months ago (1 children)

@demesisx @lysdexic No safety issues mentioned around ReaderT. The speaker was talking about how stacking monad transformers mtl-style can generate unnecessary closures that GHC can't optimise away.

[–] [email protected] 1 points 8 months ago* (last edited 8 months ago)
[–] [email protected] 2 points 8 months ago (1 children)

@armchair_progamer no mention of (mutual) recursion? It's been a while since I worked on my type checker, but I thought that you needed to separate inference into unification variable generation and constraint solving so that you don't fall into an infinite loop (each function asking the other functions type - forever).

view more: ‹ prev next ›