Skip to content

Instantly share code, notes, and snippets.

@stefan-wullems
Created May 4, 2022 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefan-wullems/34ae457911755ff69c369354ae9b371f to your computer and use it in GitHub Desktop.
Save stefan-wullems/34ae457911755ff69c369354ae9b371f to your computer and use it in GitHub Desktop.
type Id entity =
Id String
unwrap : Id entity -> String
eq : Id entity -> Id entity -> Bool
decode : Decoder (Id entity)
encode : Id entity -> Value
-- Entities -------------
type User = User
type Book = Book
-- Construct ------------
userId : String -> Id User
bookId : String -> Id Book
-- Some examples --------
getBook : Id Book -> Book
deleteUser : Id User -> Result Error ()
...etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment