[{"data":1,"prerenderedAt":249},["ShallowReactive",2],{"project-11577585":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":31,"aspects":33,"strip":35,"post_text":29,"what":37,"said":67,"maker_in_thread":132,"shape":136,"grid":141,"attempts":213,"same_week":214,"maker_shows":183,"maker_hidden":242,"reader_version":243,"card":244},"11577585","Type Inference","Hindley-Milner Type Inference Algorithm in OCaml","title","Show HN: Hindley-Milner Type Inference Algorithm in OCaml","https:\u002F\u002Fgithub.com\u002Fprakhar1989\u002Ftype-inference#hindley-milner-type-inference","github.com","krat0sprakhar",1461726351,2016,136,28,261,2264,12,"notable","languages","type inference","library",[24,21,25,26,27],"hindley-milner","ocaml","algorithm w","unification","quiet",null,{"positive":31,"neutral":32,"mixed":32,"critical":32},3,0,{"docs":34},{"positive":31,"critical":32},[36,32,32,32,36,32,32,32,32,32,32,32,32,32,36,32,32,32,32,32,32,32,32,32,32,32,32,32],5,{"problem":38,"audience":45,"pricing":29,"motivation":49,"time_to_build":29,"stack":53,"openness":64,"stage":65,"team_size":66},{"value":39,"source":40,"evidence":41},"Understanding and implementing Hindley-Milner type inference","maker",[42],{"id":43,"by":11,"text":44},"11577784","Thanks for the feedback! This is actually a smaller part of a much bigger full-blown type-inferred programming language[0], we've been working on as a part of course in school.…",{"value":46,"source":40,"evidence":47},"developers learning type inference and unification",[48],{"id":43,"by":11,"text":44},{"value":50,"source":40,"evidence":51},"Bite-sized runnable version of HM as a step toward a type-inferred language built for a course",[52],{"id":43,"by":11,"text":44},[54],{"value":55,"source":56,"evidence":57},"OCaml","commenter",[58,60],{"id":59},"post",{"id":61,"by":62,"text":63},"11577758","kragen","This is cool! It's nice to have a bite-sized runnable illustration of HM. Maybe I will finally be able to understand it — both the code and the linked lecture notes…","open_source","unknown","team",{"praise":68,"objections":88,"requests":93,"questions":104,"alternatives":112},[69,73],{"value":70,"source":56,"evidence":71},"Clear, bite-sized runnable illustration of HM",[72],{"id":61,"by":62,"text":63},{"value":74,"source":56,"evidence":75},"Helpful learning resources shared in thread",[76,80,84],{"id":77,"by":78,"text":79},"11578406","Patient0","For me, this article was the one where it \"clicked\": http:\u002F\u002Fokmij.org\u002Fftp\u002FHaskell\u002FAlgorithmsH.html#teval. Summary: type inference is just \"evaluating\" the program\u002Fexpression, but…",{"id":81,"by":82,"text":83},"11578961","eric_bullington","> I would like to see -- hint, I'm probably going to have to get my hands dirty! -- an implementation in either a dynamically typed language like…",{"id":85,"by":86,"text":87},"11577883","chubot","FWIW, I had previously bookmarked these related pages: http:\u002F\u002Fsmallshire.org.uk\u002Fsufficientlysmall\u002F2010\u002F04\u002F11\u002Fa-hindley-milner-type-inference-implementation-in-python\u002F…",[89],{"value":90,"source":56,"evidence":91},"Does not include let-polymorphism",[92],{"id":61,"by":62,"text":63},[94],{"value":95,"source":56,"evidence":96},"Step-by-step tutorial on unification and Algorithm W",[97,98,101],{"id":43,"by":11,"text":44},{"id":99,"by":62,"text":100},"11578460","I don't know if I understand unification well or not; I feel like the control flow in Algorithm W is still a bit of a mystery to me, but I suspect that this is more a function of…",{"id":102,"by":82,"text":103},"11578888","> Would you be interested in something along those lines? Yes! That would be very cool to read. I've been working on an implementation of Mini-ML in Python using Robert Small's…",[105],{"value":106,"source":56,"evidence":107},"Why type inference and unification are closely related",[108],{"id":109,"by":110,"text":111},"11578801","igravious","I second that. But I would also love to know why type inference and unification are so closely related. I mean, I learnt about Prolog (and thus unification) years ago. Like a…",[113,117,121,125],{"value":114,"source":56,"evidence":115},"Stephen Diehl's Hindley-Milner tutorial",[116],{"id":43,"by":11,"text":44},{"value":118,"source":56,"evidence":119},"Robert Small's Hindley-Milner in Python",[120],{"id":81,"by":82,"text":83},{"value":122,"source":56,"evidence":123},"Andrej Bauer's Programming Language Zoo",[124],{"id":81,"by":82,"text":83},{"value":126,"source":56,"evidence":127},"Oleg's generalization article",[128],{"id":129,"by":130,"text":131},"11577954","catnaroek","Oleg has a nice article on how to implement OCaml-style type inference. It's a more sophisticated approach than just Algorithm W: http:\u002F\u002Fokmij.org\u002Fftp\u002FML\u002Fgeneralization.html",{"comments":133,"answered":32,"key":134},1,[135],{"id":43,"text":44},{"commenters":137,"max_depth":138,"maker_replies":133,"first_comment_mins":139,"lifespan_hours":140},18,9,59,154,[142,144,146,150,153,155,157,161,162,164,166,168,170,172,175,176,179,182,184,185,188,190,193,197,200,202,205,209],[61,32,36,143,62,32],"project\u002Fpositive\u002Fdocs",[43,32,32,145,11,133],"maker\u002Fneutral\u002Fdocs",[147,32,32,148,149,32],"11577898","other\u002Fneutral\u002Fnone","BhavdeepSethi",[151,32,32,148,152,32],"11578238","edmob",[99,32,36,154,62,32],"maker\u002Fpositive\u002Fdocs",[109,32,32,156,110,32],"commenter\u002Fneutral\u002Fnone",[158,32,32,159,160,32],"11578881","other\u002Fneutral\u002Fidea","Peaker",[81,32,32,148,82,32],[163,32,32,156,110,32],"11579185",[165,32,32,148,82,32],"11579246",[167,32,32,156,110,32],"11579623",[169,32,32,148,62,32],"11620137",[171,32,32,148,110,32],"11579771",[173,32,32,148,174,32],"11579288","sklogic",[102,32,36,154,82,32],[177,32,32,178,160,32],"11578848","other\u002Fpositive\u002Fdocs",[180,133,32,148,181,32],"11578786","mbrock",[129,183,32,178,130,32],2,[77,183,32,178,78,32],[186,183,32,187,130,32],"11578440","commenter\u002Fneutral\u002Fexecution",[189,183,32,156,78,32],"11578597",[191,183,32,178,192,32],"11578583","evincarofautumn",[194,183,32,195,196,32],"11578560","other\u002Fneutral\u002Fexecution","asQuirreL",[198,31,32,178,199,32],"11578940","auggierose",[85,201,32,178,86,32],4,[203,36,32,178,204,32],"11578059","willtim",[206,207,32,148,208,32],"11583205",6,"mattydoincode",[210,211,32,148,212,32],"11578121",7,"bsaul",[],[215,220,224,229,233,237],{"id":216,"name":217,"points":218,"category":219},"11542005","Bootstrap 4 cheat sheet",847,"dev_tools",{"id":221,"name":222,"points":223,"category":20},"11555527","QBE",241,{"id":225,"name":226,"points":227,"category":228},"11540265","colornet",219,"ai",{"id":230,"name":231,"points":232,"category":219},"11542123","bot-wat",171,{"id":234,"name":235,"points":236,"category":20},"11560874","Intro.js",126,{"id":238,"name":239,"points":240,"category":241},"11547646","FocusBook",122,"productivity",false,"v2",{"id":245,"name":5,"line":6,"ai":242,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":246,"maker":11,"domain":10,"tier":19,"attempts":32,"strip":247,"url":9,"mix":248,"praise":70,"objection":90,"sub":21},11577585,[24,21,25,26,27],"5000500000000050000000000000",[31,32,32,32],1794036543758]