Skip to content

Instantly share code, notes, and snippets.

@cartazio
Last active August 29, 2015 14:05
Show Gist options
  • Save cartazio/584aad55ef6dc6d21703 to your computer and use it in GitHub Desktop.
Save cartazio/584aad55ef6dc6d21703 to your computer and use it in GitHub Desktop.
class (Ord (Key table)) => OrderedKV table where
type Key table :: *
type Value table ::*
type Address table :: *
keyRange :: table -> (Key table, Key table)
key2Address :: table -> (Key table) -> Maybe (Address table)
address2Key :: table -> (Address table) -> Key Table
nextAddress :: table -> Address table -> Maybe (Address table)
nextKey :: table -> Key table -> Maybe (Address table) ->Maybe (Key table, Address table )
sliceTable :: table -> (Address table, Address table) -> Maybe table
readTable :: table -> Address table -> Value table
@cartazio
Copy link
Author

@TranM i think my key2Address should have been key2Value. IN these apis, Key IS the notion of address

pipes makes sense as a way of streaming chunks that you work on locally, but i dont think its teh interface you want for addressing individual items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment