Re:What the interns have wrought, 2020 edition
by nesarkvechnep on Tuesday August 25, 2020 @01:29PM
(#24273753)
Just to make it clear, OCaml is not purely functional.
[ Parent
| on HN ]
Re:What the interns have wrought, 2020 edition
by non-entity on Tuesday August 25, 2020 @01:32PM
(#24273781)
Oh sorry, not sure why I thought it was.
Re:What the interns have wrought, 2020 edition
by johnisgood on Tuesday August 25, 2020 @11:23PM
(#24278778)
Yeah, it most likely is not. I mix imperative, OOP, and functional all the time. Parts of my codebase that has to do with algorithms are written using imperative style, the "public API" is OOP (class, object, methods) which makes the use of my library a breeze, and the rest is functional.
To give you an example of how you would use some crypto-related library that implemented its API (?) in OOP:
let x = new Foo.bar in
x#absorb a;
x#squeeze b;
x#reset
Or take a look at: https://github.com/xavierleroy/cryptokit/blob/master/src/cry...This (this entire file) is a great example, too!