Skip to content

Instantly share code, notes, and snippets.

@Wizek
Forked from carymrobbins/ManualKey.hs
Created May 2, 2017 23:58
Show Gist options
  • Save Wizek/dd10228f2c0e658a3b84c7e2f714699d to your computer and use it in GitHub Desktop.
Save Wizek/dd10228f2c0e658a3b84c7e2f714699d to your computer and use it in GitHub Desktop.
Yesod - manually creating a Key
-- Good
import Database.Persist.Sql
toSqlKey 1 :: UserId
-- Bad
Prelude.read "UserKey {unUserKey = SqlBackendKey {unSqlBackendKey = 1}}" :: UserId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment