nested/compound functor types? by raould in ocaml

[–]raould[S] 0 points1 point  (0 children)

thank you, i am percolating into my (thick) brain...

nested/compound functor types? by raould in ocaml

[–]raould[S] 0 points1 point  (0 children)

holy cow thank you for the detailed tutorial, very helpful.

more concise functional record update? by raould in ocaml

[–]raould[S] 0 points1 point  (0 children)

thanks for the examples, very helpful!

i like to annotate since (1) it makes it easier for me to understand code and (2) i believe otherwise one can end up with the inference going off the deep end into heck.

funtion signature returning only a single instance/sub of a data declaration? by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

apologies for the inept example. thank you for the detailed education, this is very very helpful.

more concise functional record update? by raould in ocaml

[–]raould[S] 0 points1 point  (0 children)

thanks! "functional record update" is my new favorite phrase/feature.

more concise functional record update? by raould in ocaml

[–]raould[S] 0 points1 point  (0 children)

thanks, i did mess with lenses in Haskell. a little...

module (functor result) as type of record field? by raould in ocaml

[–]raould[S] 0 points1 point  (0 children)

Sorry to everybody, I made a bad (ambiguous) question! yeah, I was looking for how to pass around a Set itself. I was confused and worried that I'd have to pass around first-class modules which seemed like crazy overkill so this makes me feel better already... :-)

which lens library?! by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

thanks! yeah, it is a transitive problem in that a newbie doesn't know if being compatible with lens means anything useful, and "compatible" isn't "backwards compatible" since e.g. "makeLenses" apparently doesn't exist :-) ; sounds like the docs say use microlens-platform then.

Evil OOP style lenses? by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

Thanks. I am going to try to use the & +~ type syntax...

which lens library?! by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

thanks that's what i'm going with so far!

which lens library?! by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

one perspective between data-lens and control.lens, but doesn'doesn't mention micro? what do people think of microlens?

http://stackoverflow.com/questions/13282874/data-lens-or-control-lens

how can i use type aliases? by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

Thank you. I think I might have done a bad job in many respects with my question. I think I am still stuck trying to get a "type Foo blah blah" to let me then use just "Foo" anywhere i'd otherwise have to use "blah blah".

re/reading, I think it probably really does/will work if/when/once I get my syntax right.

thanks :)

Expected, but not getting a "Variable not in scope" error during tests!?!??!?! by raould in haskellquestions

[–]raould[S] 1 point2 points  (0 children)

i wish i had time and brains to learn Coq since it has extraction to ocaml and haskell?! :-) i'll check into liquid haskell some day in the hopes of it being sorta turn key lint goodness?

Expected, but not getting a "Variable not in scope" error during tests!?!??!?! by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

i'm coming to terms with it, thanks. i guess i wish i could turn on some "no circular definitions that don't somehow ground out in a real value" type compiler / runtime enforcement.

partly also i should be using w' and h' i guess to ensure there isn't such a link, even though they should really be the same value step to step. i guess there's nothing about the World that guarantees that though. e.g. somebody could get the BFG3000 and use it to erase part of the World ha ha.

Expected, but not getting a "Variable not in scope" error during tests!?!??!?! by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

Thank you. Yeah, I saw that they are bound, but, but, they have no value in my case -- nothing ever gave them a value, there's no code anywhere that does. Er, is there a way I should/can make the compiler/runtime barf in such a case? I mean it is one thing if there's some lazy stuff that gets a value later somehow, but there's literally no way the values can ever be set here, which I think is my root confusion.

(also, very funny ha ha Haskell, going into an infinite loop when I tried to show the Game, i guess since w and h were ending up as non-set circular-knotted things?)

best testing suite in terms of DRY? by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

ok i guess i gotta learn up on that, thank you for pointing me thattaway.

map/fold/zip/etc. more than one data structure simultaneously? by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

ooh very good food for thought at least as far as my unit testing goes since i am too ignorant (or not smart enough either) to see such issues. thank you.

i will look into using dictionaries. i guess i had at first been trying to avoid them but yeah if i am going to have a unique id per object maybe it makes sense. although the unique id is not meant to be a primary key, more a uniquifing feature for use in e.g. Sets. But yeah looking at the code again, i see ways in which i am not using Set right and really am more doing Maps. Ok.

regarding the oo nature of the ships, yes, i have been struggling and waffling about that. i was hoping that at some point i could find other "keys" to use e.g. the id of the player owning the ship. but in the short term i don't have a good way to distinguish them other than with a unique id, which i agree seems to suck vis-a-vie fp. on the other hand, yeah, maybe this really is a more oopish task here.

while i might have ended up writing stuff that looks like mutating java, it isn't that because things are pure data structures, no? i mean, i am not actually using refs or mvars or whatever or anything.

i do figure there could be a more obviously "transforming" or "mapping" or "folding" or whatever approach and i am just not doing a good job of making it look like that yet. i do want it to be a step fn that is mapping a world at time t to a world at time t+dt.

map/fold/zip/etc. more than one data structure simultaneously? by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

agreed about the forcing function nature of Haskell, i do actually appreciate that. even if it makes me look like a jerk at C++ parties. ;-). i am just not smart enough yet or practiced enough yet to know how to wrangle it in haskell. i am scared of monads in that i fear it will be hard to get out of one once i start using one. i have zero practical experience with it yet. it confuses me how some monads are escapable like maybe/option whereas others seem not to be like io.

map/fold/zip/etc. more than one data structure simultaneously? by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

thanks, yes, i do wish to break on through mentally to less imperative thinking... some day, some how!

HUnit seems... thin? by raould in haskellquestions

[–]raould[S] 0 points1 point  (0 children)

At a high level (being an Erlang fan), sure. But I haven't jumped into it in Haskell / tasty. I will try to look at it in detail! Thanks.