This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdint.h> | |
static uint64_t hash_str(char *data) { | |
uint64_t prime = 0x100000001b3; | |
uint64_t hash = 0xcbf29ce484222325; | |
for (size_t i = 0; data[i]; i++) { | |
hash ^= (unsigned char)data[i]; | |
hash *= prime; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defprotocol Functor do | |
def fmap(data, func) | |
end | |
defprotocol Applicative do | |
def pure(data) | |
def run(wrapped_func, data) | |
end | |
defprotocol Monad do |