Sha256: ce95b56dc572879893a23beaa75edfa86acfab122fbdcfb56f505baf00195836
Contents?: true
Size: 492 Bytes
Versions: 396
Compression:
Stored size: 492 Bytes
Contents
(defmodule parallel-letter-frequency (export (dict 1))) (defun dict (strings) (let ((pid (spawn #'loop/0))) (lists:foreach (lambda (string) (! pid `#(string ,string))) strings) (! pid `#(done ,(self)))) (receive (freqs freqs))) (defun loop () (loop (dict:new))) (defun loop (freqs) (receive (`#(string ,string) (loop (lists:foldl #'frequency/2 freqs string))) (`#(done ,from) (! from freqs)))) (defun frequency (char freqs) (dict:update_counter char 1 freqs))
Version data entries
396 entries across 396 versions & 1 rubygems