Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (16 sloc) 393 Bytes
import Database.Persist.Sqlite
import Database.Persist.TH
import Control.Monad.IO.Class (liftIO)
share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistUpperCase|
Person
name String
age Int Maybe
deriving Show
|]
john = Person "John" (Just 35)
jim = Person "Jim" (Just 20)
main :: IO ()
main = do
print $ john
print $ jim
print $ john { personAge = Nothing}