Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Serenade
Nov 5, 2011

"I should really learn to fucking read"
"Learn You a Haskell" mostly worked for me with a few notable gaps.

"Learn You Some Erlang" felt like it took a similar approach but brought me up to speed much more quickly and completely. Possibly because I went into Haskell before Erlang, though.

Adbot
ADBOT LOVES YOU

Serenade
Nov 5, 2011

"I should really learn to fucking read"
Is there a good, offline resource for learning F#?

I spend a lot of time without internet and there's no "Learn you an F#" for me to lean on.

Serenade
Nov 5, 2011

"I should really learn to fucking read"
For Markov chain generation, am I incorrect in assuming it would basically use map / filter to create and clean tokens, then a reduce to boil down the list of tokens to a dictionary of Tokens mapped to tuples of weight and tokens?

I've been meaning to make a reusable one for a long time and want to use it as an excuse to further practice F#.

Serenade
Nov 5, 2011

"I should really learn to fucking read"

baka kaba posted:

I made one in F# (that was probably bad) that basically created a sequence of tokens, used windowed and map to create pairs in tuples, and then folded those into an empty Map. The folding function looked up Token1 in the map, which returned another map of all the following tokens and their counts. Then it checked that for Token2 and either incremented its count or added it as a new entry. Then after the fold it did a map converting all those counts to normalised weights

You could use a mutable Dictionary too but I was trying to be :pcgaming:functional as hell:pcgaming:
That's helpful as hell. This is mostly my plan but I didn't know windowed exists and I was thinking of fold, not reduce. Thanks.

At this moment I'm not interested in being true doom functional, but the siren's song of parallel programming is always alluring.

  • Locked thread