-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A better type notation system #9
Comments
Well, it's not Hindley-Milner, it's haskell style notation, In Hindley-Milner there's no type class constrain, haskell's type system is based on system FC. |
Can Haskell write something like this?
62b8206#diff-7fba45d6a4d001d6dd7d3667b877af1cR25 Is System F not a HM style type system? |
Ok, I try my best to be simple, because this's a complex problem, and all you want is just haskell style type notation to help address some js document issue: a) HM is not a notation system, it's a type infer system, it describes how to infer certain type from given types, it can infer simple type and rank-1 polymorphic type. e.g. forall b) HM is a restricted version of System F, because System F is undecidable at some circumstance.so System F is not a HM, but then reverse holds. c) Haskell use a heavily modified System FC type system, to infer higher rank polymorphic and kind. d) e) By writing class StringOrNumber a where
(+) :: a -> a -> a
-- (+) is an example what kind of polymorphic property you want to use in StringOrNumber and then write because from Write |
No, I don't want that. I just want to draw some ideas from HM. See the DSL part of my commit. I intend to invent a recursive way to express function type: 1 and 2 can be combined together, see how the var bar = T(
{ a: String, b: Number },
'a', 'b',
{ id: 'a', val: ['b'], foo: T({}, 'a', ['a']) }
); |
It's only on a draft stage, when it's implemented in the |
ok, maybe you should invent some name on your own, something like |
I use HM to remind me of some basic type concepts. When people mention HM, it can be a type system, not only an algorithm, and I say I don't know what you really want from here. It's apparently a memo for myself only, not an academic paper. |
Don't get me wrong, just to remind you some concept i happened to familiar with, do whatever serve you well. |
62b8206
The text was updated successfully, but these errors were encountered: