Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
compile with conduit 0.5.5 and persistent 1.1
- Loading branch information
1 parent
2b40e35
commit 4033b83
Showing
7 changed files
with
267 additions
and
259 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: scion-browser | ||
version: 0.2.12 | ||
version: 0.2.13 | ||
cabal-version: >= 1.8 | ||
build-type: Simple | ||
license: BSD3 | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,63 @@ | ||
{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies, OverloadedStrings, GADTs, FlexibleContexts, EmptyDataDecls #-} | ||
|
||
module Scion.PersistentBrowser.DbTypes where | ||
|
||
import Database.Persist | ||
-- import Database.Persist.Base | ||
import Database.Persist.Sqlite | ||
import Database.Persist.TH | ||
|
||
data DbDeclType = DbData | DbNewType | DbClass | DbInstance | DbSignature | DbType | ||
deriving (Show, Read, Eq) | ||
derivePersistField "DbDeclType" | ||
|
||
share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persist| | ||
DbPackage | ||
name String | ||
version String | ||
doc String Maybe | ||
UniqueVersion name version | ||
DbModule | ||
name String | ||
doc String Maybe | ||
packageId DbPackageId | ||
DbDecl | ||
declType DbDeclType | ||
name String | ||
doc String Maybe | ||
-- Depending on the type of decl, | ||
-- it will have some of these | ||
kind String Maybe | ||
signature String Maybe | ||
equals String Maybe | ||
moduleId DbModuleId | ||
DbTyVar | ||
name String | ||
declId DbDeclId | ||
DbFunDep | ||
name String | ||
declId DbDeclId | ||
DbContext | ||
shown String | ||
declId DbDeclId | ||
DbConstructor | ||
name String | ||
-- Called 'type' in Json output | ||
signature String | ||
declId DbDeclId | ||
|] | ||
|
||
-- |Information needed to search a package. | ||
data DbPackageIdentifier = DbPackageIdentifier String String -- name, version | ||
deriving Eq | ||
|
||
dbPackageToIdentifier :: DbPackage -> DbPackageIdentifier | ||
dbPackageToIdentifier (DbPackage name version _) = DbPackageIdentifier name version | ||
|
||
-- |Complete information for a declaration. | ||
-- Look at its ToJSON instance to know which one is used in each kind of declaration. | ||
data DbCompleteDecl = DbCompleteDecl DbDecl [DbContext] [DbTyVar] [DbFunDep] [DbConstructor] | ||
|
||
{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies, OverloadedStrings, GADTs, FlexibleContexts, EmptyDataDecls #-} | ||
|
||
module Scion.PersistentBrowser.DbTypes where | ||
|
||
import Database.Persist | ||
-- import Database.Persist.Base | ||
import Database.Persist.Sqlite | ||
import Database.Persist.TH | ||
import Data.Conduit (ResourceT) | ||
|
||
type SQL a= SqlPersist (ResourceT IO) a | ||
|
||
data DbDeclType = DbData | DbNewType | DbClass | DbInstance | DbSignature | DbType | ||
deriving (Show, Read, Eq) | ||
derivePersistField "DbDeclType" | ||
|
||
share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persist| | ||
DbPackage | ||
name String | ||
version String | ||
doc String Maybe | ||
UniqueVersion name version | ||
DbModule | ||
name String | ||
doc String Maybe | ||
packageId DbPackageId | ||
DbDecl | ||
declType DbDeclType | ||
name String | ||
doc String Maybe | ||
-- Depending on the type of decl, | ||
-- it will have some of these | ||
kind String Maybe | ||
signature String Maybe | ||
equals String Maybe | ||
moduleId DbModuleId | ||
DbTyVar | ||
name String | ||
declId DbDeclId | ||
DbFunDep | ||
name String | ||
declId DbDeclId | ||
DbContext | ||
shown String | ||
declId DbDeclId | ||
DbConstructor | ||
name String | ||
-- Called 'type' in Json output | ||
signature String | ||
declId DbDeclId | ||
|] | ||
|
||
-- |Information needed to search a package. | ||
data DbPackageIdentifier = DbPackageIdentifier String String -- name, version | ||
deriving Eq | ||
|
||
dbPackageToIdentifier :: DbPackage -> DbPackageIdentifier | ||
dbPackageToIdentifier (DbPackage name version _) = DbPackageIdentifier name version | ||
|
||
-- |Complete information for a declaration. | ||
-- Look at its ToJSON instance to know which one is used in each kind of declaration. | ||
data DbCompleteDecl = DbCompleteDecl DbDecl [DbContext] [DbTyVar] [DbFunDep] [DbConstructor] | ||
|
This file contains 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
This file contains 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
Oops, something went wrong.